Improve Librarian caching headers

Bug #5456 reported by Stuart Bishop
10
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

Dafydd Harries (daf)
Changed in launchpad:
assignee: nobody → stub
status: New → Accepted
Stuart Bishop (stub)
description: updated
summary: + Librarian should output an Expires: header
Changed in launchpad:
assignee: stub → nobody
Revision history for this message
Stuart Bishop (stub) wrote :

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.

Stuart Bishop (stub)
Changed in launchpad-foundations:
assignee: nobody → Stuart Bishop (stub)
status: Triaged → In Progress
Revision history for this message
Stuart Bishop (stub) wrote :

Dynamic max-age is pointless. Hard code to 1 year.

Revision history for this message
Diogo Matsubara (matsubara) wrote : Bug fixed by a commit

Fixed in devel r8486.

Changed in launchpad-foundations:
status: In Progress → Fix Committed
Stuart Bishop (stub)
Changed in launchpad-foundations:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.