Pylons / Pylons/webob

support cache-control: immutable

Open
#341 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

response.cache_control.immutable = True and response.cache_expires(86400, immutable=True) should work.

>>> r = Response()
>>> r.cache_expires(86400, public=True, immutable=True)
>>> r.headerlist
[('Content-Type', 'text/html; charset=UTF-8'),
 ('Content-Length', '0'),
 ('Expires', 'Tue, 09 Jan 2018 17:17:03 GMT'),
 ('Cache-Control', 'max-age=86400, public')]  # expect to see immutable in the list

Currently I can only set it manually via r.headers['Cache-Control'] += ', immutable' after calling r.cache_expires(...)`.

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 reading the Response.cache_expires and response.cache_control entry points shown in the issue, then inspect how they produce the Cache-Control header in headerlist. The work is done when both immutable=True forms include immutable in the generated Cache-Control value, without requiring manual header editing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.