class documentation

class _CacheControl(UpdateDictMixin, dict):

Known subclasses: werkzeug.datastructures.RequestCacheControl, werkzeug.datastructures.ResponseCacheControl

View In Hierarchy

Subclass of a dict that stores values for a Cache-Control header. It has accessors for all the cache-control directives specified in RFC 2616. The class does not differentiate between request and response directives.

Because the cache-control directives in the HTTP header use dashes the python descriptors use underscores for that.

To get a header of the CacheControl object again you can convert the object into a string or call the to_header method. If you plan to subclass it and add your own items have a look at the sourcecode for that class.

Changed in version 0.4: Setting no_cache or private to boolean True will set the implicit none-value which is *:

>>> cc = ResponseCacheControl()
>>> cc.no_cache = True
>>> cc
<ResponseCacheControl 'no-cache'>
>>> cc.no_cache
'*'
>>> cc.no_cache = None
>>> cc
<ResponseCacheControl ''>

In versions before 0.5 the behavior documented here affected the now no longer existing CacheControl class.

Method __init__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method to​_header Convert the stored values into a cache control header.
Class Variable cache​_property Undocumented
Class Variable max​_age Undocumented
Class Variable no​_cache Undocumented
Class Variable no​_store Undocumented
Class Variable no​_transform Undocumented
Instance Variable on​_update Undocumented
Instance Variable provided Undocumented
Method ​_del​_cache​_value Used internally by the accessor properties.
Method ​_get​_cache​_value Used internally by the accessor properties.
Method ​_set​_cache​_value Used internally by the accessor properties.

Inherited from UpdateDictMixin:

Method pop Undocumented
Method setdefault Undocumented
Class Variable __delitem__ Undocumented
Class Variable __setitem__ Undocumented
Class Variable clear Undocumented
Class Variable popitem Undocumented
Class Variable update Undocumented
def __init__(self, values=(), on_update=None):

Undocumented

def __repr__(self):

Undocumented

def __str__(self):

Undocumented

def to_header(self):
Convert the stored values into a cache control header.
cache_property =

Undocumented

max_age =

Undocumented

no_cache =

Undocumented

no_store =

Undocumented

no_transform =

Undocumented

on_update =
provided =

Undocumented

def _del_cache_value(self, key):
Used internally by the accessor properties.
def _get_cache_value(self, key, empty, type):
Used internally by the accessor properties.
def _set_cache_value(self, key, value, type):
Used internally by the accessor properties.