| 162 | | Simple caching (for development) |
|---|
| 163 | | -------------------------------- |
|---|
| 164 | | |
|---|
| 165 | | A simple, single-process memory cache is available as ``"simple:///"``. This |
|---|
| 166 | | merely saves cached data in-process, which means it should only be used in |
|---|
| 167 | | development or testing environments. For example:: |
|---|
| 168 | | |
|---|
| 169 | | CACHE_BACKEND = 'simple:///' |
|---|
| 170 | | |
|---|
| 171 | | **New in Django development version:** This cache backend is deprecated and |
|---|
| 172 | | will be removed in a future release. New code should use the ``locmem`` backend |
|---|
| 173 | | instead. |
|---|
| 174 | | |
|---|
| | 175 | |
|---|
| | 176 | Using a custom cache backend |
|---|
| | 177 | ---------------------------- |
|---|
| | 178 | |
|---|
| | 179 | **New in Django development version** |
|---|
| | 180 | |
|---|
| | 181 | While Django includes support for a number of cache backends out-of-the-box, |
|---|
| | 182 | sometimes you will want to use a customised verison or your own backend. To |
|---|
| | 183 | use an external cache backend with Django, use a Python import path as the |
|---|
| | 184 | scheme portion (the part before the initial colon) of the ``CACHE_BACKEND`` |
|---|
| | 185 | URI, like so:: |
|---|
| | 186 | |
|---|
| | 187 | CACHE_BACKEND = 'path.to.backend://' |
|---|
| | 188 | |
|---|
| | 189 | If you're building your own backend, you can use the standard cache backends |
|---|
| | 190 | as reference implementations. You'll find the code in the |
|---|
| | 191 | ``django/core/cache/backends/`` directory of the Django source. |
|---|
| | 192 | |
|---|
| | 193 | Note: Without a really compelling reason, like a host that doesn't support the |
|---|
| | 194 | them, you should stick to the cache backends included with Django. They've |
|---|
| | 195 | been really well-tested and are quite easy to use. |
|---|