#30984: Cache culling
--------------------------------------------+------------------------
Reporter: Martin Ennemoser | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 2.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------------+------------------------
I have an endpoint that needs very long to create a response since the
calculation of it takes very long. My approach was to cache the result in
a file cache and return the cached result to the user. From time to time I
asynchronously recalculate the result and update the cache. Since I don't
want to let the cache expire, I set the expire argument to None. The first
time, that worked well. But after a couple of hours, I found out that the
cache files were deleted randomly. Looking into the code of the
FileBasedCache class
https://github.com/django/django/blob/master/django/core/cache/backends/filebased.py
I noticed that there is a cull() method that randomly deletes my cache
files. This is horrible since my users don't get the cached results
anymore and have to wait very long until they get the calculated result.
Don't you consider this cull() method dangerous?
--
Ticket URL: <https://code.djangoproject.com/ticket/30984>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.cc81c22047625dead4258caf0445ecc5%40djangoproject.com.