django-cachebot icon indicating copy to clipboard operation
django-cachebot copied to clipboard

adding a model instance via django admin doesn't invalidate cache

Open iiilx opened this issue 14 years ago • 2 comments

Hey there, first off I just wanna say thanks for working on this. Everything seemed fine until I noticed one of my models "Category" wasn't getting updated when I was calling Category.objects.cache().all(). The model is set properly i.e. "objects = CacheBotManager()". Whenever I add a new category in the admin panel, I think the cache isn't getting invalidated. Both on my site and shell when Category.objects().all() is being called, the result set is missing the newly added categories. Category.objects.all() includes the correct categories as expected. Is cachebot supposed to invalidate result sets from queries such as Category.objects.all() whenever a new category is added, or is it mainly for invalidating cached model instances and not queries? I'm sorry if my wording is incorrect/confusing and thanks for your help.

iiilx avatar Jul 03 '11 20:07 iiilx

Does this only happen when you add a category from the admin panel? If you add a category from the shell does the query get invalidated?

dziegler avatar Jul 18 '11 19:07 dziegler

Sorry, I haven't used it in a while and it's not setup on my app so I'm not sure. But I think in both cases, the query didn't get invalidated.

On Mon, Jul 18, 2011 at 3:01 PM, dziegler < [email protected]>wrote:

Does this only happen when you add a category from the admin panel? If you add a category from the shell does the query get invalidated?

Reply to this email directly or view it on GitHub: https://github.com/dziegler/django-cachebot/issues/3#issuecomment-1601413

~Ben Lee

iiilx avatar Jul 18 '11 19:07 iiilx