关于response.setHeader("Cache-Control","no-cache");(转载)
来源:互联网 发布:我的世界枪械手机版js 编辑:程序博客网 时间:2024/06/02 06:04
1. response.setHeader("Cache-Control","no-cache");
This is used to prevent the browser from caching your dynamic content generated by a JSP or Servlet.
You set this attribute in the HTTP header of the response object which would tell the browser not to cache this content. So everytime you request the page again, the browser would make a new request, instead of showing you a cached page.
2.使用服务器端控制AJAX页面缓存:
response.setHeader( "Pragma", "no-cache" );
response.addHeader( "Cache-Control", "must-revalidate" );
response.addHeader( "Cache-Control", "no-cache" );
response.addHeader( "Cache-Control", "no-store" );
response.setDateHeader("Expires", 0);
单纯的使用 xmlhttp.setRequestHeader("Cache-Control","no-cache")无效。
3.Cache-Control头域
Cache-Control指定请求和响应遵循的缓存机制。在请求消息或响应消息中设置Cache-Control并不会修改另一个消息处理过程中的缓存处理过程。请求时的缓存指令包括no-cache、no-store、max-age、max-stale、min-fresh、only-if-cached,响应消息中的指令包括public、private、no-cache、no-store、no-transform、must-revalidate、proxy-revalidate、max-age。各个消息中的指令含义如下:
Public指示响应可被任何缓存区缓存。
Private指示对于单个用户的整个或部分响应消息,不能被共享缓存处理。这允许服务器仅仅描述当用户的部分响应消息,此响应消息对于其他用户的请求无效。
no-cache指示请求或响应消息不能缓存
no-store用于防止重要的信息被无意的发布。在请求消息中发送将使得请求和响应消息都不使用缓存。
max-age指示客户机可以接收生存期不大于指定时间(以秒为单位)的响应。
min-fresh指示客户机可以接收响应时间小于当前时间加上指定时间的响应。
max-stale指示客户机可以接收超出超时期间的响应消息。如果指定max-stale消息的值,那么客户机可以接收超出超时期指定值之内的响应消息。
This is used to prevent the browser from caching your dynamic content generated by a JSP or Servlet.
You set this attribute in the HTTP header of the response object which would tell the browser not to cache this content. So everytime you request the page again, the browser would make a new request, instead of showing you a cached page.
2.使用服务器端控制AJAX页面缓存:
response.setHeader( "Pragma", "no-cache" );
response.addHeader( "Cache-Control", "must-revalidate" );
response.addHeader( "Cache-Control", "no-cache" );
response.addHeader( "Cache-Control", "no-store" );
response.setDateHeader("Expires", 0);
单纯的使用 xmlhttp.setRequestHeader("Cache-Control","no-cache")无效。
3.Cache-Control头域
Cache-Control指定请求和响应遵循的缓存机制。在请求消息或响应消息中设置Cache-Control并不会修改另一个消息处理过程中的缓存处理过程。请求时的缓存指令包括no-cache、no-store、max-age、max-stale、min-fresh、only-if-cached,响应消息中的指令包括public、private、no-cache、no-store、no-transform、must-revalidate、proxy-revalidate、max-age。各个消息中的指令含义如下:
Public指示响应可被任何缓存区缓存。
Private指示对于单个用户的整个或部分响应消息,不能被共享缓存处理。这允许服务器仅仅描述当用户的部分响应消息,此响应消息对于其他用户的请求无效。
no-cache指示请求或响应消息不能缓存
no-store用于防止重要的信息被无意的发布。在请求消息中发送将使得请求和响应消息都不使用缓存。
max-age指示客户机可以接收生存期不大于指定时间(以秒为单位)的响应。
min-fresh指示客户机可以接收响应时间小于当前时间加上指定时间的响应。
max-stale指示客户机可以接收超出超时期间的响应消息。如果指定max-stale消息的值,那么客户机可以接收超出超时期指定值之内的响应消息。
- 关于response.setHeader("Cache-Control","no-cache");(转载)
- response.setHeader("Cache-Control","no-cache"); 作用
- response.setHeader("Cache-Control","no-cache"); 是干什么用的
- response.setHeader里的cache-control和pragma的区别
- 关于Cache-Control: no-cache和no-store
- response.setHeader("Cache-C…
- Cache-Control no-cache no-store
- Cache-Control: no-cache和no-store
- Cache-control”:private、no-cache、max-age
- Cache-Control: no-cache,Cac…
- Cache-Control: no-cache,Cache-Control: no-store,Pragma: no-cache区别
- Cache-Control: no-cache,Cache-Control: no-store,Pragma: no-cache区别
- JSP禁用缓存的方式 response.setHeader( "Pragma", "no-cache" ); setDateHeader("Expires", 0);的用法和什么意思
- JSP禁用缓存的方式 response.setHeader( "Pragma", "no-cache" ); setDateHeader("Expires", 0);的用法和什么意思
- Cache-control使用:header('Cache-control:private')-转载
- 关于header("Cache-control: private")
- Cache-control”常见的取值有private、no-cache
- "CACHE-CONTROL" content="NO-CACHE"
- 使用MAXDOP重复利用多处理器启用SQL Server数据压缩功能
- 假如我来架构12306网站(二) - 浅谈系统需求调研
- 实例变量和类变量区别的总结
- Windows7 64 中文版 + TortoiseSVN 64 英文版 + SVN Server 32 英文版安装过程
- ASIHttpRequest-创建和执行request
- 关于response.setHeader("Cache-Control","no-cache");(转载)
- 假如我来架构12306网站(一) - 概论
- apk 反编译
- linux read/write和fread/fwrite有什么区别
- 数据库性能优化学习
- 20131711
- 线程局部变量与 __thread
- jquery 获取select选中项文本
- JavaSE第六十八讲:Java动态代理总结