开发者

Browser cache HTML frame content

I have a HTML frame on my ASP.NET page which pionts to a static HTML file.

The problem is if I change the HTML (frame contetn开发者_开发问答t) browser still shows the previous version. Even CTRL+F5 doesn't update the browser cache.

I should paste the HTML page address in bowser and press CTRL+F5 and see the new version, then if I visit the ASP.NET page, the new contetnt would be shown in the frame.

How can I fix this?


CTRL+F5 is reloading the current page not the frame.

In firefox you have to right click the frame > This Frame > Reload. That does the the trick, I assume IE has a similar option.

Another option is to add the following headers to the content of the FRAME

<meta http-Equiv="Cache-Control" Content="no-cache">
<meta http-Equiv="Pragma" Content="no-cache">
<meta http-Equiv="Expires" Content="0">

This should force the browser to not cache.

I believe (And it's a while ago since this was done) IE6 ignored the above headers and if the frame content is dynamic a hack/work around was to append a random number to the URL when loading the frame content.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜