diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt
index 449c53c..71b0331 100644
|
a
|
b
|
offers different levels of cache granularity: You can cache the output of
|
| 34 | 34 | specific views, you can cache only the pieces that are difficult to produce, |
| 35 | 35 | or you can cache your entire site. |
| 36 | 36 | |
| 37 | | Django also works well with "upstream" caches, such as Squid |
| 38 | | (http://www.squid-cache.org/) and browser-based caches. These are the types of |
| | 37 | Django also works well with "upstream" caches, such as `Squid |
| | 38 | <http://www.squid-cache.org>`_ and browser-based caches. These are the types of |
| 39 | 39 | caches that you don't directly control but to which you can provide hints (via |
| 40 | 40 | HTTP headers) about which parts of your site should be cached, and how. |
| 41 | 41 | |
| … |
… |
loads at LiveJournal.com and subsequently open-sourced by Danga Interactive.
|
| 60 | 60 | It's used by sites such as Facebook and Wikipedia to reduce database access and |
| 61 | 61 | dramatically increase site performance. |
| 62 | 62 | |
| 63 | | Memcached is available for free at http://danga.com/memcached/ . It runs as a |
| | 63 | Memcached is available for free at http://danga.com/memcached/. It runs as a |
| 64 | 64 | daemon and is allotted a specified amount of RAM. All it does is provide a |
| 65 | 65 | fast interface for adding, retrieving and deleting arbitrary data in the cache. |
| 66 | 66 | All data is stored directly in memory, so there's no overhead of database or |
| … |
… |
the corresponding GET request; in which case it can return a cached GET
|
| 337 | 337 | response for HEAD request. |
| 338 | 338 | |
| 339 | 339 | Additionally, the cache middleware automatically sets a few headers in each |
| 340 | | ``HttpResponse``: |
| | 340 | :class:`~django.http.HttpResponse`: |
| 341 | 341 | |
| 342 | 342 | * Sets the ``Last-Modified`` header to the current date/time when a fresh |
| 343 | 343 | (uncached) version of the page is requested. |
| … |
… |
directly. This function sets, or adds to, the ``Vary header``. For example::
|
| 896 | 896 | patch_vary_headers(response, ['Cookie']) |
| 897 | 897 | return response |
| 898 | 898 | |
| 899 | | ``patch_vary_headers`` takes an ``HttpResponse`` instance as its first argument |
| 900 | | and a list/tuple of case-insensitive header names as its second argument. |
| | 899 | ``patch_vary_headers`` takes an :class:`~django.http.HttpResponse` instance as |
| | 900 | its first argument and a list/tuple of case-insensitive header names as its |
| | 901 | second argument. |
| 901 | 902 | |
| 902 | 903 | For more on Vary headers, see the `official Vary spec`_. |
| 903 | 904 | |
| … |
… |
Here's a full list:
|
| 963 | 964 | For explanation of Cache-Control HTTP directives, see the `Cache-Control spec`_. |
| 964 | 965 | |
| 965 | 966 | (Note that the caching middleware already sets the cache header's max-age with |
| 966 | | the value of the :setting:`CACHE_MIDDLEWARE_SETTINGS` setting. If you use a custom |
| | 967 | the value of the :setting:`CACHE_MIDDLEWARE_SECONDS` setting. If you use a custom |
| 967 | 968 | ``max_age`` in a ``cache_control`` decorator, the decorator will take |
| 968 | 969 | precedence, and the header values will be merged correctly.) |
| 969 | 970 | |