Django - Persistant cache

2.9k views Asked by At

Is there a way I can set a cache key indefinitely using the default django cache framework? I tried setting the timeout to 0, but that doesn't set the key at all unfortunately.

2

There are 2 answers

5
Filip Dupanović On

Someone recently mentioned Johnny Cache in an unrelated answer. It provides a infinite caching locmem and memcached backend when a timeout of 0 is provided.

0
Matt On

Django 1.6 now accepts None for the timeout argument to specify forever.

https://docs.djangoproject.com/en/dev/topics/cache/#basic-usage