Pylons / Pylons/webob

document response.cache_expires and response.cache_control

Open
#289 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs sprintable
Dominant language
Python
Stars
443
Forks
206
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the WebOb documentation for response.cache_expires and response.cache_control. Document the shown assignment and mutation forms, including how the two interfaces interact, and verify that the examples accurately describe the current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.