I have enabled basic Django query caching by adding the following to my settings.py :-
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'trialrun_cache_table'
}
}
Does Django automatically invalidate query cache for a particular table if data is inserted or updated? If not, How should I go about implementing this behavior?
I think you've misunderstood what the DatabaseCache is. It is not a cache of your database, it's a cache in your database; that is, when you explicitly cache something, it'll be stored in a table in your db. It's still up to you to actually do any caching, and similarly it's up to you to do any cache invalidation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With