Ticket #14782: cache-doc-updates.diff

File cache-doc-updates.diff, 2.8 KB (added by Adam Vandenberg, 14 years ago)
  • docs/topics/cache.txt

    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  
    3434specific views, you can cache only the pieces that are difficult to produce,
    3535or you can cache your entire site.
    3636
    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
     37Django also works well with "upstream" caches, such as `Squid
     38<http://www.squid-cache.org>`_ and browser-based caches. These are the types of
    3939caches that you don't directly control but to which you can provide hints (via
    4040HTTP headers) about which parts of your site should be cached, and how.
    4141
    loads at LiveJournal.com and subsequently open-sourced by Danga Interactive.  
    6060It's used by sites such as Facebook and Wikipedia to reduce database access and
    6161dramatically increase site performance.
    6262
    63 Memcached is available for free at http://danga.com/memcached/ . It runs as a
     63Memcached is available for free at http://danga.com/memcached/. It runs as a
    6464daemon and is allotted a specified amount of RAM. All it does is provide a
    6565fast interface for adding, retrieving and deleting arbitrary data in the cache.
    6666All 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  
    337337response for HEAD request.
    338338
    339339Additionally, the cache middleware automatically sets a few headers in each
    340 ``HttpResponse``:
     340:class:`~django.http.HttpResponse`:
    341341
    342342    * Sets the ``Last-Modified`` header to the current date/time when a fresh
    343343      (uncached) version of the page is requested.
    directly. This function sets, or adds to, the ``Vary header``. For example::  
    896896        patch_vary_headers(response, ['Cookie'])
    897897        return response
    898898
    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
     900its first argument and a list/tuple of case-insensitive header names as its
     901second argument.
    901902
    902903For more on Vary headers, see the `official Vary spec`_.
    903904
    Here's a full list:  
    963964For explanation of Cache-Control HTTP directives, see the `Cache-Control spec`_.
    964965
    965966(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
     967the value of the :setting:`CACHE_MIDDLEWARE_SECONDS` setting. If you use a custom
    967968``max_age`` in a ``cache_control`` decorator, the decorator will take
    968969precedence, and the header values will be merged correctly.)
    969970
Back to Top