Drop-in replacement for the default Django memcached backend?
Closed this issue · 4 comments
The README is not explicit on this: I just wanted confirm that django-memcached-pool is a drop in replacement for the default Django memcached backend implementation? E.g. that we you switch from the default implementation to django-memcached-pool you are not going to lose any cached e.g. due to different key format or similar issues.
I can contribute README updates when some of the developers confirm this.
It's not a drop-in replacement. I received this error when I didn't flush the cache:
"UnpicklingError: invalid load key, '�'."
Any insight what is causing this? What does the underlying umemcache library do differently?
Based on the commits, looks like they changed Python pickle version in some point, might it be that?
I've seen this myself. I think part of the issue is that data already in memcache isn't pickled, so if data exists for the key you're using, it won't unserialize. However, I've seen this even after restarting memcached. To resolve this, I added a try/except around the pickle.loads in the unserialize method. Everything seems to work as expected after that.
Edit: I should note, I'm using this in conjunction with johnny-cache. So that may have played a part in it. I'm still toying around so I'll update this ticket if I find anything else.