Closed Bug 1364441 Opened 7 years ago Closed 7 years ago

Use Cache-Control immutable

Categories

(Socorro :: Infra, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: peterbe, Assigned: peterbe)

Details

Attachments

(3 files)

Firefox, as of version 49, supports 'Cache-Control: immutable'. It means that the server doesn't even bother to send a GET with 'If-Modified-Since	' (to which our Nginx most likely will respond 304 Not Modified).

Basically, if you reload the page (e.g. to see if the data has changed) the client will send a GET for every single asset and Nginx will respond 304 for each one. 

For example, loading https://crash-stats.mozilla.com/search/?product=Firefox&version=54.0b&_dont_run=1 and hitting the Reload button will make 28 GET requests that all got a 304 response. 

If you use `Cache-Control: immutable` the browser doesn't even bother sending those GETs again (...to see if they've changed). Ultimately, this makes reloads faster for the users and less requests to your Nginx.
SHIFT-Reload first.
Regular Reload (before adding 'immutable')
Regular Reload (after 'immutable' has been added and 1 Shift-Reload was done). 

Note! I also had a `tail -f /tmp/socorro.access.log` running when I did this reload. Only the HTML document and the one (or two) XHR requests appeared there. Before, it was a whole page (of 304 requests).
Here's a good article about the feature: https://www.keycdn.com/blog/cache-control-immutable/
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: