django-redis-cache
django-redis-cache copied to clipboard
zero timeout
Hi. I've found some inconsistency in documents.
The documentation says that timeout with None
value cache is set indefinitely. And according to the implementation of BaseRedisCache._set
method it also works for zero value.
On the other hand, official Django documentation says that: A timeout of 0 won’t cache the value.
Please let me know what do you think about this.
I agree it's quite confusing to directly contradict the Django docs on this. If you don't intend to change the behavior, there should at least be a very visible notice in the docs or readme.
Combine this with the automatic casting of the timeout to int, and you'll have any timeout between 0 and 1 last indefinitely as well. Wasted a couple of hours because of this. https://github.com/niwinz/django-redis seems to work properly in this situation.