stronglink
stronglink copied to clipboard
Caching of "generic" previews is incorrect
Right now we cache all of our previews, like converted Markdown and plain text.
We also cache the "generic" preview for files of an otherwise unrecognized type. This preview template can present a variety of file meta-data like title, description, etc. However, this meta-data can change (at least, be appended) after the preview is generated, in which case the preview becomes stale.
We should probably always generate generic previews in real time. In which case, we probably want to hit the database once, load all of the relevant meta-data, and then write out the preview.
We need an API for loading several meta-data attributes at once. Then we should load all of the meta-data for all of the results in one transaction. We know the template fields in advance, although we don't necessarily know whether the generic preview will be used...?