1. Bruce Kroeze
  2. django-keyedcache
  3. Issues
Issue #12 open

Values are pickled surprisingly complicated

Hynek Cernoch
created an issue

I looked into cache contents and I see that all objects are wrapped by keyedcache.CacheWrapper object and then pickled by Django.core.cache.
For example the integer 5 is saved like

# by keyedcache
'\x80\x02ckeyedcache\nCacheWrapper\nq\x01)\x81q\x02}q\x03(U\tinprocessq\x04\x89U\x03valq\x05Nub.'
# directly by Django cache
'\x80\x02K\x05.'

There are seen unimportant identifiers ['keyedcache', 'CacheWrapper', 'inprocess', 'val'] in every value.

I wrote a documantation to unclear parts and now I think that keyedcache can be easy modified to be more transparent if a known value is cached and will be complicated only if a Function Caching "in process" is used.

Comments (4)

  1. Hynek Cernoch reporter

    The removed Cache prefix is automatically handled by Django. It is not a necessary part of Keyedcache. An additional automatic preffix can be useful with threaded multihost because any static value is not useful for it.

    The method cache_enable is never used by Satchmo. I expect it useful only for testing purposes. (The current simple implementation can cause problems in other modules or with obsoleted values. The cache can be easy disabled globally by settings.CACHES.)

  2. Log in to comment