The current flow for generating a preview is:
- Download the assets from object storage to a local directory
- Add the .eno files
- Call Faircamp to generate the preview
- Upload the preview files to object storage
- Delete the local directory
Previews are already taking almost a minute to generate in production (they only take a few seconds locally in development), presumably because of Faircamp transcoding on our wimpy box. It would be nice to save the cache directory of the local folder so that while someone is editing their site, subsequent previews would be much faster.
Of course, if we indefinitely save all the cache directories, we're back to a world where we have all of everyone's data on the local volumne. We should set a TTL and treat this like an actual cache, that gets cleared if the user hasn't made any action on the site for N seconds.
The current flow for generating a preview is:
Previews are already taking almost a minute to generate in production (they only take a few seconds locally in development), presumably because of Faircamp transcoding on our wimpy box. It would be nice to save the
cachedirectory of the local folder so that while someone is editing their site, subsequent previews would be much faster.Of course, if we indefinitely save all the cache directories, we're back to a world where we have all of everyone's data on the local volumne. We should set a TTL and treat this like an actual cache, that gets cleared if the user hasn't made any action on the site for N seconds.