开发者

Forcing users to grab new site content, not use cache

We just rolled out a completely new website, with a lot of the old images gone. We have been swamped by called from clients this morning because they can't get access to the sites content because they are still using cache on the page. Is there a way using the meta tags or something that will force them not to use the开发者_JS百科 cache content? This will just be temporary for a week, then we will remove it, just so our users have the latest site up. Thanks.


Why not change the HTML source to show a different URL to the images and resources so the browser is forced to download a new version. This technique is used a lot to invalidate the browsers cache. Here is an example:

<img src="/logo.jpg?version=1">
<link rel="stylesheet" type="text/css" href="/style.css?version=1">


<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

Indicates cached information should not be used and instead requests should be forwarded to the origin server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜