-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Future Dev
-
None
There are a few different use cases in the file system where a file is derived from another file, or from another source, and can be re-created if needed.
Some examples:
- thumbnails of larger images
- images created from document conversions
- pdf certificates generated deterministically from templates and data
- plugins which resize images or video for better delivery
Some of these have their own methods of storing the files and tracking them so that they might get cleaned up. Things like thumbnails are not stored in the filearea of the original and so won't be backed up and restored which is a good thing, and if the original document is deleted them it will eventually get cleaned up too.
It would be good to extend this concept to be more generic so that all of these classes of files can be marked as 'derived' and so they can be considered for premature deletion to free up room, and if they are needed again then they can safely be regenerated on demand. There could be a convenience cli which can be run with an age threshold to remove them, or a cron task and a policy to clean them up..
The other key thing is that we don't necessarily want to clean derived files up based on when they were generated but based on when they where last used and so we'd need to add a lastviewed timestamp to the files table. This should not need to be updated every time, it could be updated at most once a day so heavily viewed files aren't constantly being touched.
Case by case we'd also have to make sure that they won't be regenerated by cron in cases where they are pregenerated as that would defeat the purpose of this.
- is child of
-
IDEA-241 Improve Performance and Efficiency with Smarter Image Handling
-
- Waiting for triage
-