Module rhino.http

Functions

cache_control(max_age=None, private=False, public=False, s_maxage=None, must_revalidate=False, proxy_revalidate=False, no_cache=False, no_store=False)

Generate the value for a Cache-Control header.

Example:

>>> from rhino.http import cache_control as cc
>>> from datetime import timedelta
>>> cc(public=1, max_age=3600)
'public, max-age=3600'
>>> cc(public=1, max_age=timedelta(hours=1))
'public, max-age=3600'
>>> cc(private=True, no_cache=True, no_store=True)
'private, no-cache, no-store'