Changeset 583
- Timestamp:
- 08/31/05 12:06:07 (3 years ago)
- Files:
-
- django/trunk/docs/cache.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/cache.txt
r283 r583 15 15 The cache framework is split into a set of "backends" that provide different 16 16 methods of caching data. There's a simple single-process memory cache (mostly 17 useful as a fallback) , a database-backed cache, and a memcached_ backend (by18 far the fastest option ifyou've got the RAM).17 useful as a fallback) and a memcached_ backend (the fastest option, by far, if 18 you've got the RAM). 19 19 20 20 Before using the cache, you'll need to tell Django which cache backend you'd 21 21 like to use. Do this by setting the ``CACHE_BACKEND`` in your settings file. 22 22 23 The CACHE_BACKEND setting is a "fake" URI (really an unregistered scheme). 23 The CACHE_BACKEND setting is a "fake" URI (really an unregistered scheme). 24 24 Examples: 25 25 … … 29 29 memcached://127.0.0.1:11211/ A memcached backend; the server is running 30 30 on localhost port 11211. 31 32 db://tablename/ A database backend (the db backend uses33 the same database/username as the rest of34 the CMS, so only a table name is needed.)35 31 36 32 simple:/// A simple single-process memory cache; you … … 63 59 64 60 DB_CACHE = "memcached://127.0.0.1:11211/?timeout=60" 65 DB_CACHE = "db://tablename/?timeout=120&max_entries=500&cull_percentage=4"66 61 67 62 Invalid arguments are silently ignored, as are invalid values of known … … 173 168 >>> cache.delete('a') 174 169 175 Really, that's the entire API! There are very few restrictions on what you can 176 use the cache for; you can store any object in the cache that can be pickled 177 safely, although keys must be strings. 170 That's it. The cache has very few restrictions: You can cache any object that 171 can be pickled safely, although keys must be strings. 178 172 179 173 .. _memcached: http://www.danga.com/memcached/
