Package wsgitools :: Module middlewares :: Class CachingMiddleware
[hide private]
[frames] | no frames]

Class CachingMiddleware

source code

Caches reponses to requests based on SCRIPT_NAME, PATH_INFO and QUERY_STRING.

Instance Methods [hide private]
 
__init__(self, app, maxage=60, storable=<function storable at 0x28d8500>, cacheable=<function cacheable at 0x28d8ed8>) source code
 
__call__(self, environ, start_response)
wsgi interface
source code
Method Details [hide private]

__init__(self, app, maxage=60, storable=<function storable at 0x28d8500>, cacheable=<function cacheable at 0x28d8ed8>)
(Constructor)

source code 
Parameters:
  • app - is a wsgi application to be cached.
  • maxage (int) - is the number of seconds a reponse may be cached.
  • storable - is a predicate that determines whether the response may be cached at all based on the environ dict.
  • cacheable - is a predicate that determines whether this request invalidates the cache.

__call__(self, environ, start_response)
(Call operator)

source code 

wsgi interface

Parameters:
  • environ ({str: str})