If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Use Cache-Control immutable

RESOLVED FIXED

Status

Socorro
Infra
RESOLVED FIXED
4 months ago
4 months ago

People

(Reporter: peterbe, Assigned: peterbe)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Assignee)

Description

4 months ago
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.
(Assignee)

Comment 1

4 months ago
Created attachment 8867202 [details]
Screen Shot 2017-05-12 at 9.58.50 AM.png

SHIFT-Reload first.
(Assignee)

Comment 2

4 months ago
Created attachment 8867203 [details]
Screen Shot 2017-05-12 at 9.59.01 AM.png

Regular Reload (before adding 'immutable')
(Assignee)

Comment 3

4 months ago
Created attachment 8867204 [details]
Screen Shot 2017-05-12 at 10.02.57 AM.png

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).
(Assignee)

Comment 4

4 months ago
PR https://github.com/mozilla/socorro-infra/pull/307
(Assignee)

Comment 5

4 months ago
Here's a good article about the feature: https://www.keycdn.com/blog/cache-control-immutable/

Comment 6

4 months ago
Commit pushed to master at https://github.com/mozilla/socorro-infra

https://github.com/mozilla/socorro-infra/commit/3fd949bf16506792f1174bfc02c0b7d2a72582e3
fixes bug 1364441 - Use Cache-Control immutable (#307)

Updated

4 months ago
Status: NEW → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.