3 ms·
What does that matter?
by tverbeure 2y ago
What does that matter?
- oefrha 2y agoWith long expiry/immutable assets, only the HTML needs to be refetched from the server on refreshes or subsequent visits, instead of everything after merely ten minutes. On slow and/or high latency networks the difference can be huge. And you don’t even need to intentionally refresh — mobile browsers have been evicting background tabs since the dawn of time, and Chrome brought this behavior to desktop a while ago to save RAM (on by default).
- tverbeure 2y agoOk. I don't think this is a big deal for the vast majority of blogs, like mine, that are hosted on GH pages. It's just HTML and some photos that are unique per post. But I also don't see why GH would put the number so low.
- pfg_ 2y agoPresumably so that when it shows the checkmark and says your website was updated you don't go there and wonder why it hasn't updated for you
- oefrha 2y agoBecause they have this one max-time for everything, from things that should be refetched frequently (html, unversioned scripts and stylesheets, etc.) to things that should be immutable (versioned scripts and stylesheets, images, etc.). They don’t understand your website. You do, and you can set exactly the right headers for the best user experience. Btw you can set the right headers with Netlify and Vercel as well.
- adriancr 2y agoBut they are not refetched if etag is used properly: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ET... Most you have is some HEAD requests.
- oefrha 2y agoBy refetch I mean re-requested, which can return 304 responses. You still have to do a roundtrip for each resource in that case, and many websites (including static ones) have this waterfall of requests where html includes scripts and scripts include other scripts, especially now that some geniuses are pushing adoption of native esm imports instead of bundling. The roundtrips add up, and good luck if your link is unreliable in addition to being high latency. Compare that to proper caching where a refresh doesn’t request anything except maybe the html. I have experienced the web on such a link and it’s a shitshow.
- adriancr 2y agoSeems like a problem with the websites and not the cache expiry. I have also experienced this, during dial up period, I agree its not pretty and most dont even consider it.