This is some wikidicts tracing and questions in order to understand how wikidicts and caching work together.
User requests a page, for example: http://127.0.0.1:8080/MyPage Than it calls wikidicts.py:
init GroupDict object
load_dicts:
- instance cacheEntry object with defined key and arena
get the currently disk_cache_id-> cache.uid()
uid is a tuple (write here what that represents- it is mtime, string,...)
- try to:
self.__dict__.update(self.cfg.cache.DICTS_DATA)
update dict ( DICTS_DATA ) - loading data from cache
- if there is no cache or is no uptodate - reset and force to load from disk (check the new uid and compare - current_disk_cache_id != self.disk_cache_id )
- except:
- got the cache content - this is something that's a bit confusing (see questions)
- update dictionary with currently read data from cache
- update cache id
save data and cache id to -> data and update DICTS_DATA
- later if someone requests for a group page again it only reads DICTS_DATA if a page content wasn't changed
Questions
Here are some questions I'm not sure that I understand the process and I tried to give an answer/s to it, or some options,
1.What is the difference between getting the cache.DICTS_DATA and cache.content()
cache.content() - it reads data from a disk (it's cached but it's on a disk and has to access disk) Does is need always to access the disk?
No, if it's pickled it does: data = pickle.loads(data)
cache.DICTS_DATA - it's not only data from disk - it has cache_id , data, ... - but I'm not sure where is DICTS_DATA saved - it cant be read from disk but not sure
see into request.init. request parameters needs to be initialized