Force browser to clear cache

后端 未结 17 2353
夕颜
夕颜 2020-11-22 05:04

Is there a way I can put some code on my page so when someone visits a site, it clears the browser cache, so they can view the changes?

Languages used: ASP.NET, VB.N

17条回答
  •  眼角桃花
    2020-11-22 05:56

    In addition to setting Cache-control: no-cache, you should also set the Expires header to -1 if you would like the local copy to be refreshed each time (some versions of IE seem to require this).

    See HTTP Cache - check with the server, always sending If-Modified-Since

提交回复
热议问题