Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cache immutable #632

Closed
andymckay opened this issue Jun 22, 2016 · 9 comments
Closed

Use cache immutable #632

andymckay opened this issue Jun 22, 2016 · 9 comments

Comments

@andymckay
Copy link

http://bitsup.blogspot.ca/2016/05/cache-control-immutable.html?m=1

This will cut down on all those super fast 304 hits, as long as our URLs are definitely immutable. Rumour has its landing in Firefox 49.

@muffinresearch
Copy link
Contributor

@bqbn when you have a moment could you look at adding this to all our statics served from the CDN that currently have far-future expires?

@bqbn
Copy link
Contributor

bqbn commented Oct 27, 2017

Yep, I'll try to implement this next week.

@bqbn
Copy link
Contributor

bqbn commented Oct 27, 2017

This is filed under addons-frontend repo, but I assume this is for the desktop site as well?

@kumar303
Copy link
Contributor

I assume this is for the desktop site as well?

I think we only want it for assets served from the CDN

@bqbn
Copy link
Contributor

bqbn commented Oct 31, 2017

I assume this is for the desktop site as well?

I think we only want it for assets served from the CDN

So I assume the answer to my question is yes, since the desktop site uses CDN too.

@muffinresearch
Copy link
Contributor

So I assume the answer to my question is yes, since the desktop site uses CDN too.

Yes any static assets that are currently served with far future expires and require a url change to bust cache.

@muffinresearch muffinresearch added this to the 2017.11.09 milestone Nov 2, 2017
@muffinresearch muffinresearch changed the title Consider using cache immutable Use cache immutable Nov 2, 2017
@muffinresearch muffinresearch modified the milestones: 2017.11.09, 2017.11.16 Nov 9, 2017
@bqbn
Copy link
Contributor

bqbn commented Jan 24, 2018

This is now on -dev and -stage.

@muffinresearch
Copy link
Contributor

Looks good to me:

CSS:

add-ons_for_firefox

JS:

add-ons_for_firefox

@bqbn Out of interest I note on this response there are two headers rather than one:

add-ons_for_firefox

@bqbn
Copy link
Contributor

bqbn commented Feb 2, 2018

This is now on -prod as well.

I notice that files that are already in CDN before today's release will still get 304. But if you change the number in the query string to some random value, it'll force the CDN to talk to the origin (nginx in this case) to retrieve the file and the immutable header.

I don't know if it's worth the effort invalidating our CDN cache though. One side effect of doing that is more requests will hit the origin and increases its load. I think overtime with new releases coming out, more and more files will get the immutable cache-control header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants