1. A computer-implemented method comprising: collecting data on user activity for a plurality of files uploaded to and stored in a web-based collaboration environment, wherein each of the stored plurality of files has a specific input format; collecting frequency data on how frequently a plurality of classes of input formats are previewed and a preview generation duration data, wherein the preview generation duration is an amount of conversion time it takes to generate a preview for each of the plurality of classes of input formats; analyzing the collected user activity data, frequency data and preview generation duration data to determine at least one criterion that a preview is likely to be requested for a subset of the plurality of files; upon determining that a given file meets the at least one criterion, pregenerating, from the specific input format of the given file, a target format suitable for providing a preview of the given file; and upon receiving a preview request for the given file from a requesting user, using the pregenerated target format to provide the preview of the given file to the requesting user.