I have problems using the django cache. It looks like the cached items are not readable between processes. Is that by design? I haven't found any information on it.
Testing on the production server using two ssh sessions in parallel, and setting the cache in one and reading in the other using the memcache backend (also tested with file based backend), and this was the result:
(session 1):
>>> from django.core.cache import cache
>>> cache.set('foo','bar')
>>> cache.get('foo')
'bar'
(session 2):
>>> from django.core.cache import cache
>>> cache.get('foo', 0) #Cache has not been set yet...
0
>>> cache.get('foo', 0) #Cache has been set in other session, I expect 'bar' here
0
I use the low level cache api to cache the processed results of an
uploaded file. The user then complete some more steps that describe
the uploaded data at which point it's entered in the DB. This is done
asynchronously using apache2 with one thread per process, mod_wsgi and
python 2.5. The problem I ran in to was that the "cache.get('<filekey>')"
always returns None when I test and upload a file.
Thanks