Answer the question
In order to leave comments, you need to log in
How to remove value from cache in Django?
Tell me how to remove the value from the cache when updating. The REST API caches a list of rarely changed reference. But he is still changing. At the time of creating a new entry or deleting, you need to update the existing cache keys. Faced with a similar problem?
REST API on DRF.
Answer the question
In order to leave comments, you need to log in
If the data in the database is changed only through the Django application, then the easiest way is to hang up the handler on the signal to save / delete the model and clear the cache.
https://docs.djangoproject.com/en/3.1/topics/signals/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question