Force refresh of browser-cache for HTML document

隐身守侯 提交于 2020-01-16 04:10:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!