comparison MoinMoin/ @ 6023:7e3e406f21d9

introduce a new caching scope "userdir" Needed this because none of the existing scopes is usable for caching data related to the data that is contained in the user_dir (user profiles). This is a problem for shared user_dir scenarios, when multiple wikis share the same user_dir. This is common in farm setups with single-sign-on. "farm" scope can't be used though as not all farm wikis are required to share the users. Also, non-farm setups may also have shared user_dir. Thus, best is to have this new caching scope (and even have it stored inside the user_dir directory, so it is automatically the "right" directory without needing further configuration). Having the "cache" directory inside the user_dir is no issue as the user profiles follow a specific naming pattern and we filter for that pattern.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 11 Feb 2014 16:18:47 +0100
parents 4c6a4adf0540
equal deleted inserted replaced
6022:fa5f81a0dfa9 6023:7e3e406f21d9
30 return arena.getPagePath('cache', check_create=1) 30 return arena.getPagePath('cache', check_create=1)
31 elif scope == 'wiki': 31 elif scope == 'wiki':
32 return os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena) 32 return os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena)
33 elif scope == 'farm': 33 elif scope == 'farm':
34 return os.path.join(request.cfg.cache_dir, '__common__', arena) 34 return os.path.join(request.cfg.cache_dir, '__common__', arena)
35 elif scope == 'userdir':
36 return os.path.join(request.cfg.user_dir, 'cache', arena)
35 elif scope == 'dir': 37 elif scope == 'dir':
36 # arena is a specific directory, just use it 38 # arena is a specific directory, just use it
37 return arena 39 return arena
38 return None 40 return None
39 41