<span style="background-color: #eeeeee;">
</span>
<h2 style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; line-height: 19px; margin-top: 10px; font-size: 1em;"><a id="ctl09_TitleUrl" style="color: #0000ff; text-decoration: none; font-size: 13px;" href="http://www.cnblogs.com/kaixin110/archive/2010/09/06/1818830.html">session_cache_limiter(private,must-revalidate)是什么意思</a></h2>
<div id="cnblogs_post_body">
<ul class="row-1" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-left: 45px; border-bottom-width: 0px; border-bottom-style: none; border-bottom-color: initial;">
<li id="articleContent" class="pro-content">
<div>
<div style="width: 760px;">
<p style="font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">
表义一:
<p style="font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">
表义二:
</li>
</ul>
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">?
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">?
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">?
<ul style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-left: 45px;">
1.使用session_cache_limiter方法:
</ul>
<span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: x-small;"><span style="line-height: 19px;"><span style="white-space: pre;"> </span></span></span>
<span style="line-height: 19px; white-space: pre; background-color: #fafafa;">session_cache_limiter('private,must-revalidate'); </span><span style="background-color: #eeeeee;">
<div>
<span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: x-small;"><span style="line-height: 19px;">?<br></span></span>
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">但是要值得注意的是session_cache_limiter()方法要写在session_start()方法之前才有用;
<ul style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-left: 45px;">
2.用header来设置控制缓存的方法:
</ul>
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">?
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">第一,使用Header方法设置消息头Cache-control?<br>引用:<br>header('Cache-control: private, must-revalidate');//支持页面回跳<br>第二,使用session_cache_limiter方法?<br>引用:<br>//注意要写在session_start方法之前<br>session_cache_limiter('private, must-revalidate');
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">Public指示响应可被任何缓存区缓存。
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">no-cache指示请求或响应消息不能缓存
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">max-age指示客户机可以接收生存期不大于指定时间(以秒为单位)的响应。
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">max-stale指示客户机可以接收超出超时期间的响应消息。如果指定max-stale消息的值,那么客户机可以接收超出超时期指定值之内的响应消息。
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">问:为什么我在点击浏览器的后退按钮后,所有字段的信息都被清空了?
<p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px;">补充:还有基于session的解决方法,在session_start前加上?<br>引用:<br>session_cache_limiter('nocache');// 清空表单<br>session_cache_limiter('private'); //不清空表单,只在session生效期间<br>session_cache_limiter('public'); //不清空表单,如同没使用session一般
</span>
?