TIL: cache-control is as inconsistent as it can get in different Browsers
Pankaj Patel

Pankaj Patel @pankajpatel

About: Programmer, Blogger, Photographer and little bit of everything

Location:
Lyon, France
Joined:
Mar 5, 2019

TIL: cache-control is as inconsistent as it can get in different Browsers

Publish Date: Feb 5 '21
0 0

Today a colleague started asking questions on cache-control and how to achieve consistent behaviour so that he can control it from Server Side

Then another colleague pointed out a StackOverflow thread where the answer makes sense but raises a question on why do these differences exist?

I got it. Google Chrome ignores the Cache-Control or Expires header if you make a request immediately after another request to the same URI in the same tab (by clicking the refresh button, pressing the F5 key or pressing Command + R). It probably has an algorithm to guess…

I think I still don't understand it completely after this revelation.

I suggested that we can use Service Workers to intercept all requests and implement better caching strategy there.

In response, another colleague pointed out that SWs are not worth the work and the support is inconsistent.

which lead me to here: https://caniuse.com/serviceworkers

caniuse.com_serviceworkers

Which again raises this question what is best approach to control caches from server?

Comments 0 total

    Add comment