Skip to content

Instantly share code, notes, and snippets.

@mbox
mbox / Dualcache
Last active September 3, 2019 16:14
Two-level cache for Django
To use the two-layer cache:
* Run memcached on each Django webserver
* Add "LOCAL_CACHE_ADDR = ('127.0.0.1:11211',)" to settings.py
* Replace "from django.core.cache import cache" with "from dualcache import cache" everywhere
you want to use the two-layer cache. It can be freely mix and matched with Django's default caching.