Set the negotiation cache, and the browser reads the cache directly without sending a request to the server to confirm whether the cache resource is valid

The catch-control:max-age=0 set by the

resource server should normally be that every time accesses the domain name it should send a request to the resource server to confirm whether the cache of index.html is valid, but the second visit (figure 2) Why does the domain name not like the third time (figure 3) send a request to confirm whether the cache is valid, but read the cache directly?

  • visit the domain name for the first time, normal

  • --

Jun.14,2022

you can't read this question. As far as I know, if the browser doesn't read the resources in the cache, it can only read the requested resources.


it's a little strange to see how your date date compares to the current date


there is no point in carrying max-age=0 on the client. This is the header used by the server to control the cache policy, and no-store or no-cache is the header that the client should carry.

nothing can be seen according to the three pictures. The cache read mechanism in the browser is very complicated. Generally speaking, there are several categories, and it is impossible to draw a more reliable conclusion through the comparison of the three images.


if there is no catch-control:max-age=0 in your first response header, then you must go to cache


previously nginx did not configure cache. After learning, I summarized nginx configuration cache & gzip

.
Menu