Cache Versioning instead of Aggressive Deletion

13 views
Skip to first unread message

Benjamin Liles

unread,
May 15, 2013, 2:08:51 PM5/15/13
to django-cms...@googlegroups.com
I propose using Django cache versioning instead of aggressive deletion of caches. When making certain changes, the permissions cache and menu cache are aggressively deleted. In the case of permissions cache, this results in 9 times the number of users you have active on your system in delete calls to the cache. In my case, that's over 62,000 calls to cache delete when only a handful of those calls actually delete anything.

The Django caching layer supports using versions and incrementing a key. Putting those together, there could be a key/value pair for the current version which is incremented when "clearing" the cache and then the new, higher value is used when accessing the cache. None of the old data would be accessible and would eventually be automatically be removed by the cache system when it expires.

I should have a pull request for it in soon based on the support/2.4.x branch since it's the latest release branch.
Reply all
Reply to author
Forward
0 new messages