> * The timeout handling code should be abstracted behind > _get_memcache_timeout(). That utility already exists to ensure the > eccentricities of memcached timeout handling are supported, and I > can't see an obvious reason why we can't put this check in there too. >
The problem is I can't think of a good way to force instant-expiring sets in pylibmc. The only way to fake the response is to alter the actual return value. 0 and all negative numbers, in pylibmc, set for never expire. And even a timeout of 1 second currently causes the cache template tag tests to fail. This may end up meaning we need to actually change the template tests, but within that constraint, I can't see a way to do it using _get_memcache_timeout. A bit more on this below your can of worms note > * You've got the CACHE_SETTINGS handling happening in the cache > backend itself, whereas the historical arrangement has been to handle > all the settings in the backend loader, and pass them into the backend > instance as arguments. > I'll look at how DATABASES settings are being handled a little bit more closely and get the patch up to snuff. > Now for the can of worms -- I'm wondering if there is some potential > for doing a weasel job with respect to infinite timeouts. You > rectified the library to ensure that negative timeout values are > turned into instant expiration, which is for consistency with the > other memcache backends. > > However, I can't find any specific reference in Django's docs to the > behavior of cache backends when timeout is negative. I'm wondering if > this might be the weasel way into getting infinite timeouts -- even if > it's in conjunction with a clause like "if the backend supports them". The only reference is implicit in the tests. the first ten or so tests for cache template tag use negative timeouts as a way to check that the cache tag doesn't pull in expired data. Based on your response, we could change these tests to work with infinite timeouts and trust users to know how their backend handles specific things, maybe making a note in the doc. -Jacob > > Yours, > Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
