

def cache_page(*args, **kwargs):
    "\n    Decorator for views that tries getting the page from the cache and\n    populates the cache if the page isn't in the cache yet.\n\n    The cache is keyed by the URL and some data from the headers.\n    Additionally there is the key prefix that is used to distinguish different\n    cache areas in a multi-site setup. You could use the\n    sites.get_current_site().domain, for example, as that is unique across a Django\n    project.\n\n    Additionally, all headers from the response's Vary header will be taken\n    into account on caching -- just like the middleware does.\n    "
    if ((len(args) != 1) or callable(args[0])):
        raise TypeError('cache_page has a single mandatory positional argument: timeout')
    cache_timeout = args[0]
    cache_alias = kwargs.pop('cache', None)
    key_prefix = kwargs.pop('key_prefix', None)
    if kwargs:
        raise TypeError('cache_page has two optional keyword arguments: cache and key_prefix')
    return decorator_from_middleware_with_args(CacheMiddleware)(cache_timeout=cache_timeout, cache_alias=cache_alias, key_prefix=key_prefix)

dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/views/decorators/cache.py cache_page/original