Does Django-Ratelimit clear its own keys? #235
-
|
Good day I Googled for this but could not seem to find any answer. And then the same question for e.g. memcached/Redis. I forgot to add I am using django-ratelimit 3.0.1, django 2.2.19 running on Windows Server 2012 R2. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Checking the code, The filesystem cache doesn't implement expiration or LRU, but it does obey the Technically |
Beta Was this translation helpful? Give feedback.
Checking the code,
django-ratelimitdoes set expiration times on the keys it creates so that they should last slightly longer than the required window.The filesystem cache doesn't implement expiration or LRU, but it does obey the
CULL_FREQUENCYandMAX_ENTRIESoptions. But since eviction is random, rather than LRU, that may not be the best choice.Technically
django-ratelimitshould work with any Django cache backend that implements atomic increment—memcached, Redis, and even theLocMembackends do, but the filesystem backend does not. Ratelimit is designed assuming situations where you're likely running an application on multiple hosts and will need a shared caching setup.