Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document response.cache_expires and response.cache_control #289

Open
mmerickel opened this issue Oct 25, 2016 · 0 comments
Open

document response.cache_expires and response.cache_control #289

mmerickel opened this issue Oct 25, 2016 · 0 comments

Comments

@mmerickel
Copy link
Member

response.cache_expires is a convenience method wrapping around response.cache_control.

response.cache_expires = 50 # seconds from now

response.cache_expires(seconds, **kw)

However, you can also mutate response.cache_control directly in several ways. For example, you can set it to a cache-control header string, or you can tweak properties on it directly.

response.cache_control = 'no-cache, must-revalidate'

response.cache_control.no_cache = True
response.cache_control.must_revalidate = True
response.cache_control.max_age = 50  # seconds from now

Anyway I always need to look this up so it'd be nice if it were documented better. They also interact in interesting ways if you use both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants