btrask / stronglink

A searchable, syncable, content-addressable notetaking system
Other
1.04k stars 39 forks source link

Caching of "generic" previews is incorrect #58

Open btrask opened 9 years ago

btrask commented 9 years ago

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.

btrask commented 9 years ago

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...?