Improve Librarian caching headers
Bug #5456 reported by
Stuart Bishop
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Medium
|
Stuart Bishop |
Bug Description
Librarian should output an Expires: header
The content that a LibraryFileAlias points to never changes (the only thing
that modifies LibraryFileContent and LibraryFileAlias rows is the
Librarian). We should make the Librarian output the relevant headers stating
that 'this content will never expire' to proxies.
Currently we just output the Last-Modified: header which helps cachability,
but we can do better by simply adding an Expires: header set to a year in the future.
Related branches
lp:~stub/launchpad/librarian-cache-headers
Merged
into
lp:launchpad
- Graham Binns (community): Approve
- Diff: 0 lines
Changed in launchpad: | |
assignee: | nobody → stub |
status: | New → Accepted |
description: | updated |
summary: | + Librarian should output an Expires: header |
Changed in launchpad: | |
assignee: | stub → nobody |
Changed in launchpad-foundations: | |
assignee: | nobody → Stuart Bishop (stub) |
status: | Triaged → In Progress |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
We should be outputting a Cache-Control header so browsers cache files locally, significantly improving rendering times:
Cache-Control: max-age=31536000, public
It would be good if the max-age was set to (now - file_creation_ time). This way the max-age increases the longer the file has been in the Librarian. The rationale for this is the longer the file has been in the Librarian, the less likely it is to need to be removed for security reasons and the less effect that removal will have anyway. This way, we can avoid setting the s-max-age parameter to avoid major caches keeping copies of data that potentially might need to be removed for security reasons, while letting our local Squid cache work without overrides.