Skip to content

Conversation

damz
Copy link
Collaborator

@damz damz commented Jul 30, 2018

Interestingly, long-term caching for media and static assets was never enabled by default. Enabling this has a dramatic effect on the user experience, especially in the admin area. This is only safe when static content signing is enabled, but it is current force enabled as part of the ECE tools.

Copy link
Collaborator

@JacobBrownAustin JacobBrownAustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.
I think there was some confusion about this because there's two conflicting things I've heard since I started on this team.
A) Static files are cached for a very long time because they are versioned.
B) Browser caching is disabled because Fastly is so good that we don't need browser caching at all.

B Doesn't really make sense because even if Fastly is the best thing ever, it's still not as quick as local filesystem.

@shiftedreality
Copy link
Member

@damz can't we use max instead of 1y?

@damz
Copy link
Collaborator Author

damz commented Aug 26, 2018

B) Browser caching is disabled because Fastly is so good that we don't need browser caching at all.
B Doesn't really make sense because even if Fastly is the best thing ever, it's still not as quick as local filesystem.

Yes, the correct statement should actually be:

B) Browser caching is disabled for mutable resources so that invalidation takes effect immediately.

Immutable resources (i.e. static assets, media) should be infinitely cached.

can't we use max instead of 1y?

No, our parser expects a proper duration here.

@shiftedreality shiftedreality merged commit 32da402 into magento:master Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants