faust.web.cache

class faust.web.cache.Cache(timeout: Union[datetime.timedelta, float, str] = None, key_prefix: str = None, backend: Union[Type[faust.types.web.CacheBackendT], str] = None, **kwargs) → None[source]

Cache interface.

ident = 'faustweb.cache.view'
view(timeout: Union[datetime.timedelta, float, str] = None, key_prefix: str = None, **kwargs) → Callable[Callable, Callable][source]

Decorate view to be cached.

Return type:Callable[[Callable], Callable]
can_cache_request(request: faust.types.web.Request) → bool[source]
Return type:bool
can_cache_response(request: faust.types.web.Request, response: faust.types.web.Response) → bool[source]
Return type:bool
key_for_request(request: faust.types.web.Request, prefix: str = None, method: str = None) → str[source]
Return type:str
build_key(request: faust.types.web.Request, method: str, prefix: str, headers: List[str]) → str[source]
Return type:str
coroutine get_view(self, key: str, view: faust.types.web.View) → Optional[faust.types.web.Response][source]
Return type:Optional[Response]
coroutine set_view(self, key: str, view: faust.types.web.View, response: faust.types.web.Response, timeout: Union[datetime.timedelta, float, str]) → None[source]
Return type:None