Django

Code

Show
Ignore:
Timestamp:
07/25/08 13:51:32 (4 months ago)
Author:
mtredinnick
Message:

Fixed #7398 -- Allow for custom cache-backends to be used.

Based on a patch from Lau Bech Lauritzen and Brenton Simpson.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/cache.txt

    r7754 r8075  
    77from database queries to template rendering to business logic -- to create the 
    88page that your site's visitor sees. This is a lot more expensive, from a 
    9 processing-overhead perspective, than your standard read-a-file-off-the-filesystem 
    10 server arrangement. 
     9processing-overhead perspective, than your standard 
     10read-a-file-off-the-filesystem server arrangement. 
    1111 
    1212For most Web applications, this overhead isn't a big deal. Most Web 
     
    186186 
    187187    CACHE_BACKEND = 'dummy:///' 
     188 
     189Using a custom cache backend 
     190---------------------------- 
     191 
     192**New in Django development version** 
     193 
     194While Django includes support for a number of cache backends out-of-the-box, 
     195sometimes you will want to use a customised verison or your own backend.  To 
     196use an external cache backend with Django, use a Python import path as the 
     197scheme portion (the part before the initial colon) of the ``CACHE_BACKEND`` 
     198URI, like so:: 
     199 
     200    CACHE_BACKEND = 'path.to.backend://' 
     201 
     202If you're building your own backend, you can use the standard cache backends 
     203as reference implementations. You'll find the code in the 
     204``django/core/cache/backends/`` directory of the Django source. 
     205 
     206Note: Without a really compelling reason, like a host that doesn't support the 
     207them, you should stick to the cache backends included with Django. They've 
     208been really well-tested and are quite easy to use. 
    188209 
    189210CACHE_BACKEND arguments