Mercurial > moin > 1.9
changeset 3874:87b63ed39102
cache action: cleanup docstrings / TODO
author | Thomas Waldmann <tw AT waldmann-edv DOT de> |
---|---|
date | Sat, 19 Jul 2008 13:33:15 +0200 |
parents | e5a9570d3001 |
children | 3b1ab037ec09 |
files | MoinMoin/action/cache.py |
diffstat | 1 files changed, 6 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/action/cache.py Sat Jul 19 13:29:16 2008 +0200 +++ b/MoinMoin/action/cache.py Sat Jul 19 13:33:15 2008 +0200 @@ -7,7 +7,7 @@ ------------ Assume we have a big picture (bigpic) and we want to efficiently show some thumbnail (thumbpic) for it: - + # first calculate a (hard to guess) cache key (this key will change if the # original data (bigpic) changes): key = cache.key(..., attachname=bigpic, ...) @@ -22,16 +22,6 @@ url = cache.url(..., key) html = '<img src="%s">' % url - - TODO: - * add secret to wikiconfig - * add error handling - * maybe use page local caching, not global: - + smaller directories - - but harder to clean - - harder to backup data_dir - * move file-like code to caching module - * add auto-key generation? @copyright: 2008 MoinMoin:ThomasWaldmann @license: GNU GPL, see COPYING for details. @@ -54,7 +44,12 @@ # Do NOT get this directly from request.form or user would be able to read any cache! cache_arena = 'sendcache' # just using action_name is maybe rather confusing + +# We maybe could use page local caching (not 'wiki' global) to have less directory entries. +# Local is easier to automatically cleanup if an item changes. Global is easier to manually cleanup. +# Local makes data_dir much larger, harder to backup. cache_scope = 'wiki' + do_locking = False def key(request, wikiname=None, itemname=None, attachname=None, content=None, secret=None):