Hacker News new | ask | show | jobs
by thangngoc89 571 days ago
Edit: below isn’t true. You could set immutable in cache header and the browser wouldn’t verify.

—— Original comment:

With browser cache, the browser stills need to send a HEAD request to see if the content was modified. These requests are noticeable when networks are spotty (train, weak mobile signals…)

Service Worker could cache the request and skip the head requests all together

2 comments

Set max-age in the Cache-Control header to a high value and the browser will not need to revalidate. When deploying a new version, "invalidate" the browser cache by using a different filename.
Or keep the file name and send the file with a query string of some changed numeric value
Not if you tell the browser it's guaranteed fresh for 10 minutes and then use cache-busting in the URL
Oh yeah. The immutable tag right? Total forgot about that