问题
A website was accidentally cached in the browser for about a month with Expires and max-age headers set.
The cached resource is text/html
and the root /
.
The freshness validation should work as expected with the If-Modified-Since
header in the next request. But somehow a lot of IE users (incl. IE11) don't get the new version anymore, as the browser doesn't make the request.
It's easy to bust the cache for resources like CSS, but how to do this for the document/website itself? I can not just change the URL.
回答1:
Add in the .htaccess or apache config this
ExpiresActive on
ExpiresByType text/html "access plus 0 seconds"
Taken from h5bp apache config. If you use some other server software, checkout all h5bp server-configs repo for similar code.
来源:https://stackoverflow.com/questions/30509243/force-refresh-of-browser-cache-for-html-document