[1.2.X] Fixed #14782 - Add/fix links in docs/topics/cache.txt. Thanks to adamv for the patch.
Backport of r14717 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14718 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
56dc22d64c
commit
f26dae8fb2
@ -34,8 +34,8 @@ offers different levels of cache granularity: You can cache the output of
|
|||||||
specific views, you can cache only the pieces that are difficult to produce, or
|
specific views, you can cache only the pieces that are difficult to produce, or
|
||||||
you can cache your entire site.
|
you can cache your entire site.
|
||||||
|
|
||||||
Django also works well with "upstream" caches, such as Squid
|
Django also works well with "upstream" caches, such as `Squid
|
||||||
(http://www.squid-cache.org/) and browser-based caches. These are the types of
|
<http://www.squid-cache.org>`_ and browser-based caches. These are the types of
|
||||||
caches that you don't directly control but to which you can provide hints (via
|
caches that you don't directly control but to which you can provide hints (via
|
||||||
HTTP headers) about which parts of your site should be cached, and how.
|
HTTP headers) about which parts of your site should be cached, and how.
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ loads at LiveJournal.com and subsequently open-sourced by Danga Interactive.
|
|||||||
It's used by sites such as Facebook and Wikipedia to reduce database access and
|
It's used by sites such as Facebook and Wikipedia to reduce database access and
|
||||||
dramatically increase site performance.
|
dramatically increase site performance.
|
||||||
|
|
||||||
Memcached is available for free at http://danga.com/memcached/ . It runs as a
|
Memcached is available for free at http://memcached.org/. It runs as a
|
||||||
daemon and is allotted a specified amount of RAM. All it does is provide a
|
daemon and is allotted a specified amount of RAM. All it does is provide a
|
||||||
fast interface for adding, retrieving and deleting arbitrary data in the cache.
|
fast interface for adding, retrieving and deleting arbitrary data in the cache.
|
||||||
All data is stored directly in memory, so there's no overhead of database or
|
All data is stored directly in memory, so there's no overhead of database or
|
||||||
@ -331,7 +331,7 @@ user-specific pages (include Django's admin interface). Note that if you use
|
|||||||
``AuthenticationMiddleware``.
|
``AuthenticationMiddleware``.
|
||||||
|
|
||||||
Additionally, the cache middleware automatically sets a few headers in each
|
Additionally, the cache middleware automatically sets a few headers in each
|
||||||
``HttpResponse``:
|
:class:`~django.http.HttpResponse`:
|
||||||
|
|
||||||
* Sets the ``Last-Modified`` header to the current date/time when a fresh
|
* Sets the ``Last-Modified`` header to the current date/time when a fresh
|
||||||
(uncached) version of the page is requested.
|
(uncached) version of the page is requested.
|
||||||
@ -793,8 +793,9 @@ directly. This function sets, or adds to, the ``Vary header``. For example::
|
|||||||
patch_vary_headers(response, ['Cookie'])
|
patch_vary_headers(response, ['Cookie'])
|
||||||
return response
|
return response
|
||||||
|
|
||||||
``patch_vary_headers`` takes an ``HttpResponse`` instance as its first argument
|
``patch_vary_headers`` takes an :class:`~django.http.HttpResponse` instance as
|
||||||
and a list/tuple of case-insensitive header names as its second argument.
|
its first argument and a list/tuple of case-insensitive header names as its
|
||||||
|
second argument.
|
||||||
|
|
||||||
For more on Vary headers, see the `official Vary spec`_.
|
For more on Vary headers, see the `official Vary spec`_.
|
||||||
|
|
||||||
@ -860,7 +861,7 @@ Here's a full list:
|
|||||||
For explanation of Cache-Control HTTP directives, see the `Cache-Control spec`_.
|
For explanation of Cache-Control HTTP directives, see the `Cache-Control spec`_.
|
||||||
|
|
||||||
(Note that the caching middleware already sets the cache header's max-age with
|
(Note that the caching middleware already sets the cache header's max-age with
|
||||||
the value of the ``CACHE_MIDDLEWARE_SETTINGS`` setting. If you use a custom
|
the value of the :setting:`CACHE_MIDDLEWARE_SECONDS` setting. If you use a custom
|
||||||
``max_age`` in a ``cache_control`` decorator, the decorator will take
|
``max_age`` in a ``cache_control`` decorator, the decorator will take
|
||||||
precedence, and the header values will be merged correctly.)
|
precedence, and the header values will be merged correctly.)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user