Does Chrome violate caching standards?

We noticed the Chrome cache files on the local computer and did not even send a request to our server to check if there is a newer version of the javascript file.

Example HTTP response headers for the js file that Google cached:

Accept-Ranges:bytes Access-Control-Allow-Headers:Content-Type Access-Control-Allow-Methods:GET, POST, PUT, DELETE, OPTIONS Access-Control-Allow-Origin:* Content-Encoding:gzip Content-Length:5479 Content-Type:application/javascript Date:Tue, 12 Jan 2016 22:46:07 GMT ETag:"7d68e1ceb647d11:0" Last-Modified:Tue, 05 Jan 2016 12:44:25 GMT Server:Microsoft-IIS/8.5 Vary:Accept-Encoding x-robots-tag:noindex 

Did Chrome really cache the file? There is no Cache-control header or one that declares that a file can be cached locally, it only has ETag and Last-Modified.


BTW

Is there a way (possibly a title) to tell Chrome to check if the cached file has changed without adding a version to the file name ? Setting up no-cache is not an option, as I want it to be cached, but I want to use the ETag and Last-Modified headers, as it should be.

+5
source share
1 answer

Unless specifically limited by cache control (section 14.9) directive, the cache system MAY always save a successful response (see section 13.8) as a cache entry, MAY return it without checking if it is fresh, and MAY return it after a successful check.

You can always use the must-revalidate directive.

If the must-revalidate directive is present in the received cache response, this cache MUST NOT use the entry after it becomes obsolete to respond to a subsequent request without first checking its source server.

A source

+1
source

Source: https://habr.com/ru/post/1240503/


All Articles