简体   繁体   English

HTML5缓存什么都没有

[英]HTML5 cache nothing

I don't want to cache anything on my site. 我不想在我的网站上缓存任何内容。 my cache.manifest looks like this: CACHE MANIFEST 我的cache.manifest看起来像这样:CACHE MANIFEST

# Cache manifest version 1.1

CACHE:
#nothing to cache.

NETWORK:
#force no cache
*

This is decalred at header 这在标题处是十分重叠的

<html manifest="/cache.manifest">

which is included in each page. 包含在每个页面中。

<%@ include file="/WEB-INF/html/header.html" %>

Contents are still being cached. 内容仍在缓存中。 Firefox still displays the warning "This website {example.com} is asking to store data on your computer for offline use". Firefox仍会显示警告“此网站{example.com}要求在您的计算机上存储数据以供离线使用”。

Details specs: 详细规格:
Apache 2.2 Apache 2.2
Tomcat 7 雄猫7
cache.manifest is at root. cache.manifest是root。
app is ROOT.war , which is serving root of domain. 应用程序是ROOT.war,它是域的根。
Am I missing something? 我错过了什么吗?

A manifest is for specifying what content you want to be cached for offline use . 清单用于指定要缓存以供脱机使用的内容 It has nothing to do with regular caching. 它与常规缓存无关。

Firefox will prompt for storing data for offline use any time there is a manifest attribute on the html element, even if the value of it doesn't do anything useful. 只要html元素上有manifest属性,Firefox就会提示存储数据以供离线使用,即使它的值没有做任何有用的事情。

If you want to control regular caching, then use cache control HTTP headers such as: 如果要控制常规缓存,请使用缓存控制HTTP标头,例如:

An Expires in the past. 过去的Expires

Expires: Fri, 30 Oct 1998 14:19:41 GMT

And/Or Cache-Control : 和/或Cache-Control

Cache-Control: max-age=0, no-store

What's the reason behind using a manifest? 使用清单背后的原因是什么?

HTTP headers are the place for cache control. HTTP标头是缓存控制的地方。 Add Cache-Control: no-cache in your response headers. 在响应标头中添加Cache-Control: no-cache http://condor.depaul.edu/dmumaugh/readings/handouts/SE435/HTTP/node24.html http://condor.depaul.edu/dmumaugh/readings/handouts/SE435/HTTP/node24.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM