kolibri
kolibri copied to clipboard
Implement an LRU cache mechanism for cached remotely streamed content
The last accessed time for any files imported in this way should be stored in some sort of cache record. This cache record should be wiped if the file is removed either due to an LRU eviction mechanism, deletion explicitly from Kolibri, or by explicit import by Kolibri.
It's possible that this could be achieved simply by relying on the last_accessed timestamp provided by file stats, and then just removing files that are not logged in the Kolibri database as available (and hence having been explicitly imported by a user) and that have been least recently accessed.
This could be called during automatic content import operations, and during periodic cleanup tasks.