如何停止缓存html但继续缓存其他资源

如何停止缓存html但继续缓存其他资源,html,caching,cookies,browser,Html,Caching,Cookies,Browser,我希望浏览器只缓存图像,而不缓存html文档,因为当我修改.html时,浏览器会显示缓存的旧版本。 这是在中指定的manifest.appcache: 缓存清单 设置: 喜欢在线 网络: * 回退: 缓存: /img/cap.gif /img/descarga(53.gif) /img/descarga(3.gif) /img/descarga(7.gif) 我已尝试指定http头 缓存控制:无缓存,最大年龄=0 过期:日期等于日期标题,未来1分钟,过去1年 Pragma:无缓存 正如我在另一个

我希望浏览器只缓存图像,而不缓存html文档,因为当我修改
.html
时,浏览器会显示缓存的旧版本。 这是在中指定的
manifest.appcache

缓存清单

设置: 喜欢在线

网络:

*

回退:

缓存:

/img/cap.gif

/img/descarga(53.gif)

/img/descarga(3.gif)

/img/descarga(7.gif)

我已尝试指定http头

缓存控制
:无缓存,最大年龄=0

过期
:日期等于日期标题,未来1分钟,过去1年

Pragma
:无缓存

正如我在另一个问题中看到的,我在html头部设置了标记:

meta http equiv=“缓存控制”content=“max age=0”

metahttp equiv=“缓存控制”content=“无缓存”

metahttp equiv=“expires”content=“0”

meta-http-equiv=“expires”content=“1980年1月1日星期二1:00:00 GMT”

metahttp equiv=“pragma”content=“无缓存”


但是这些都不行,浏览器会缓存图像和html,还有另一种解决方案吗?谢谢。

将其放在.htaccess这个特定文件类型的停止缓存中

<filesMatch "\.(jpeg,png)$">
FileETag None
<ifModule mod_headers.c>
 Header unset ETag
 Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
 Header set Pragma "no-cache"
 </ifModule>
</filesMatch>

FileTag无
标题未设置ETag
标题集缓存控制“最大年龄=0,无缓存,无存储,必须重新验证”
标题集Pragma“无缓存”

看看这是否有帮助:我成功地改变了清单的版本,就像这里建议的那样,似乎没有更好的解决方案。。