日期:2014-05-17  浏览次数:20631 次

HTML缓存问题。。。
我们的网站每次F5刷新都会重新加载一遍,有很多图片,所以加载的很是麻烦
但是我看很多网站加载完后可以脱机运行的那种,
声明一下,我们网站头文件没有加

<META HTTP-EQUIV="pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Cache-Control" CONTENT="no-store, must-revalidate"> 
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"> 
<META HTTP-EQUIV="expires" CONTENT="0"> 

这种东西,那是不是就应该默认是加载完就有缓存呢??但是不知道为什么F5刷新他就会重新加载一遍。。。这是什么原因????
------解决方案--------------------
可以考虑用frameset及frame给网站分区,如下
<frameset framespacing="0" border="0" frameborder="0" rows="85,*,20">
<frame name="top" scrolling="no" noresize target="contents" src="TopMenu.aspx">
<frameset id="id" cols="190,*">
<frame name="contents" target="main" src="LeftMenu.aspx" scrolling="yes">
<frame name="main" src="MainPage.aspx" scrolling="yes">
</frameset>
<frame name="bottom" scrolling="no" noresize target="contents" src="BottomMenu.aspx">
<noframes>
<body>
<p>您的浏览器不支持框架。</p>
</body>
</noframes>
</frameset>

这样页面刷新或页面跳转时有很多东西就不需要重复加载了
------解决方案--------------------
浏览器本身也在做缓存
你可以f12开debug看看他们每次请求的http状态和其中的说明
------解决方案--------------------
刷新不就是重新请求服务器吗!!!