Closed tvb closed 6 years ago
@tvb absolutely. I'll look at getting some cache control headers added to our assets hosts. I'll drop you an update when we've had the chance to get that done.
@SirRawlins got an update for me?
@tvb hey Tristan, I've added some cache headers, they're fairly conservative but should improve your grading. Did you want to re-test and let me know what it makes of them?
Huge improvement there!
Some notes though:
Leverage browser caching of static assets: 82/100
...
FAILED - (17.5 minutes) - https://code.sorryapp.com/status-bar/4.latest/status-bar.min.css
WARNING - (60.0 minutes) - https://code.sorryapp.com/status-bar/4.latest/status-bar.min.js
WARNING - (60.0 minutes) - https://code.sorryapp.com/status-bar/4.latest/fonts/Icons/status-bar-icons.woff
...
@tvb awesome, I'm so pleased to hear it. 🎉
The other notes here are to be expected, ideally we'd like to set much longer cache headers than 60 minutes, however, it makes rolling out changes and fixes slower, so for now, we find a compromise at 1 hour.
Really appreciate your help and suggestions with this.
@SirRawlins Why would that be an issue? You can set the proper cache-control headers and just invalidate the cache at the CloudFront side whenever you push an update ci/cd style 🤓
@tvb for sure! Our build process does invalidate Cloudfront, but the cache-control headers are also used by the browser to cache a copy locally, which we are not able to invalidate.
At least that's my understanding, but I may be wrong. 🤓
I'm not sure because CloudFront will present you with a Miss the first time after an invalidation and so it serves it to the client. I'm pretty sure the client follows but we should test it..
@tvb interesting! I'll reopen this issue and try to test this, see if I can confirm.
@tvb I did a little experimentation on this today, and it seems my initial hunch was right, setting the cache-control header means the asset is cached in two locations.
1) In Cloudfront, which we're able to purge. 2) In the Browser, which we are NOT able to purge.
The only way for the browser to pickup new versions is to wait until the content has expired, and then grab the latest version from the CDN.
So for now I think we'll keep the short expiry window. I have some potential work-arounds, but I think they'll wait for another day.
Roger!
Hi,
I am getting a F rating in webpagetest.org because of the following:
can you guys please fix this?