﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27641	Document limitations of the Locmem cache backend	Adam Johnson	Adam Johnson	"The default CACHES that Django uses is defined in `global_settings` as:

{{{
CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
    }
}
}}}

Django also enforces that you have a cache called 'default' defined: https://docs.djangoproject.com/en/1.10/ref/checks/#caches

`LocMemCache` only works within a single process and thus is not suitable for even the smallest application deployments these days, which nearly always use multiple web worker processes under uWSGI/gunicorn. (For example, [https://github.com/unbit/uwsgi-docs/blob/master/tutorials/heroku_python.rst this uWSGI Heroku tutorial] has config for 4 processes). 

The way Django uses caching is to assume there's a single cache for the whole application which could lead code to break in unexpected ways in production.

I'd like to suggest either:

1. A deployment check that the cache used in production is not locmemcache
2. The default cache backend used in `global_settings` be changed to `DummyCache`

Since (2) is probably highly backwards incompatible, I think (1) is preferable."	Cleanup/optimization	closed	Documentation	1.10	Normal	fixed		me@…	Accepted	1	0	0	0	0	0
