#437 closed enhancement (duplicate)
[patch] In memory file cache
Reported by: | nesh <nesh [at] studioquattro [dot] co [dot] yu> | Owned by: | Jacob |
---|---|---|---|
Component: | Core (Cache system) | Version: | |
Severity: | normal | Keywords: | |
Cc: | nesh@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Attached to this ticket is a implementation of in memory based file cache. I got basic idea from vampire TemplateCache and re-implemented it to make more general.
Usage is simple, if you want to cache a file just call cache = get_cache('<cache name>')
and then file_contents = cache.load('filename')
. It will detect if the file is modified since last access and reload file.
I'm currently using it for caching translation objects for Ticket #65.
Attachments (1)
Change History (4)
by , 19 years ago
Attachment: | filecache.diff added |
---|
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Component: | Tools → Cache system |
---|---|
Owner: | changed from | to
Note:
See TracTickets
for help on using tickets.
Usefull example: