How to cache RetrieveModelMixin with persistent cache #8521
Unanswered
mfoglio
asked this question in
Question & Answer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following Django REST view:
Accessing a single method will call the
retrieve
function thanks tomixins.RetrieveModelMixin
. I would like to speed up the function since it requires multiple queries and it uses a lot of CPU.In particular:
As of now I tried to overwrite the view
retrieve
method:and to set the default cache to disk:
I don't think it is working, as I need to cache about 2 million items (I have about 2 millions records): the folder
/home/django_cache
uses less than a Mb and it's size changes every time I call the API.Beta Was this translation helpful? Give feedback.
All reactions