Logo Search packages:      
Sourcecode: paste version File versions  Download package

paste::httpheaders::_CacheControl Class Reference

Inheritance diagram for paste::httpheaders::_CacheControl:

paste::httpheaders::_MultiValueHeader paste::httpheaders::HTTPHeader

List of all members.


Detailed Description

Cache-Control, RFC 2616 14.9  (use ``CACHE_CONTROL``)

This header can be constructed (using keyword arguments), by
first specifying one of the following mechanisms:

  ``public``

      if True, this argument specifies that the
      response, as a whole, may be cashed.

  ``private``

      if True, this argument specifies that the response, as a
      whole, may be cashed; this implementation does not support
      the enumeration of private fields

  ``no_cache``

      if True, this argument specifies that the response, as a
      whole, may not be cashed; this implementation does not
      support the enumeration of private fields

In general, only one of the above three may be True, the other 2
must then be False or None.  If all three are None, then the cache
is assumed to be ``public``.  Following one of these mechanism
specifiers are various modifiers:

  ``no_store``

      indicates if content may be stored on disk;
      otherwise cache is limited to memory (note:
      users can still save the data, this applies
      to intermediate caches)

  ``max_age``

      the maximum duration (in seconds) for which
      the content should be cached; if ``no-cache``
      is specified, this defaults to 0 seconds

  ``s_maxage``

      the maximum duration (in seconds) for which the
      content should be allowed in a shared cache.

  ``no_transform``

      specifies that an intermediate cache should
      not convert the content from one type to
      another (e.g. transform a BMP to a PNG).

  ``extensions``

      gives additional cache-control extensions,
      such as items like, community="UCI" (14.9.6)

The usage of ``apply()`` on this header has side-effects. As
recommended by RFC 2616, if ``max_age`` is provided, then then the
``Expires`` header is also calculated for HTTP/1.0 clients and
proxies (this is done at the time ``apply()`` is called).  For
``no-cache`` and for ``private`` cases, we either do not want the
response cached or do not want any response accidently returned to
other users; so to prevent this case, we set the ``Expires`` header
to the time of the request, signifying to HTTP/1.0 transports that
the content isn't to be cached.  If you are using SSL, your
communication is already "private", so to work with HTTP/1.0
browsers over SSL, consider specifying your cache as ``public`` as
the distinction between public and private is moot.

Definition at line 630 of file httpheaders.py.


Public Member Functions

def __call__
def __lt__
def __new__
def __repr__
def __str__
def apply
def compose
def delete
def parse
def tuples
def update
def values

Public Attributes

 category
 name
 reference
 sort_order
 version

Static Public Attributes

string category = 'general'
dictionary extensions = {}
int ONE_DAY = 24
int ONE_HOUR = 60
int ONE_MONTH = 30
int ONE_WEEK = 7
int ONE_YEAR = 52
string reference = ''
string version = '1.1'

Private Member Functions

def _compose

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index