I’m trying to expire a view-level cache on a model’s post_save (that was set via https://docs.djangoproject.com/en/1.3/topics/cache/?from=olddocs#the-per-view-cache). I did some googling and found this answer here on SO: Expire a view-cache in Django? but it’s not working for me.
I asked around in the #django room on freenode and the consensus was that this was probably due to the recent caching changes made in 1.3
Does anyone have any idea on how I can wipe out the cache entry for a model keyed off it’s get_absolute_url()?
I figured it out!
Cheers to ilvar for pointing me in the right direction. My implementation is below. I created a property named
cache_keyand added a post_save receiver onto the sub class of the models whose view-level caches I needed to clear after they had been updated. Suggestions for improvement are always welcome!