Skip to content

Does Django-Ratelimit clear its own keys? #235

Answered by jsocol
necrolingus asked this question in Q&A
Discussion options

You must be logged in to vote

Checking the code, django-ratelimit does 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_FREQUENCY and MAX_ENTRIES options. But since eviction is random, rather than LRU, that may not be the best choice.

Technically django-ratelimit should work with any Django cache backend that implements atomic increment—memcached, Redis, and even the LocMem backends 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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@necrolingus
Comment options

Answer selected by necrolingus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants