📄 function.httpresponse-setcache.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Set cache</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.httpresponse-setbuffersize.html">HttpResponse::setBufferSize</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.httpresponse-setcachecontrol.html">HttpResponse::setCacheControl</a></div> <div class="up"><a href="class.httpresponse.html">The HttpResponse</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.httpresponse-setcache" class="refentry"> <div class="refnamediv"> <h1 class="refname">HttpResponse::setCache</h1> <p class="verinfo">(PECL pecl_http:0.10.0-1.5.5)</p><p class="refpurpose"><span class="refname">HttpResponse::setCache</span> — <span class="dc-title">Set cache</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">static</span> <span class="type">bool</span> <span class="methodname"><b><b>HttpResponse::setCache</b></b></span> ( <span class="methodparam"><span class="type">bool</span> <tt class="parameter">$cache</tt></span> )</div> <p class="para rdfs-comment"> Whether it should be attempted to cache the entity. </p> <p class="para"> This will result in necessary caching headers and checks of clients <i>If-Modified-Since</i> and <i>If-None-Match</i> headers. If one of those headers matches a <i>304 Not Modified</i> status code will be issued. </p> <blockquote><p><b class="note">Note</b>: If you're using sessions, be sure that you set session.cache_limiter to something more appropriate than "no-cache"! <br /> </p></blockquote> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">cache</tt></i></span> <dd> <p class="para"> whether caching should be attempted </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <b><tt>TRUE</tt></b> on success or <b><tt>FALSE</tt></b> on failure. </p> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="methodname"><b><a href="function.httpresponse-setcachecontrol.html" class="function" rel="rdfs-seeAlso">HttpResponse::setCacheControl</a></b></span></li> <li class="member"> <span class="methodname"><b><a href="function.httpresponse-getcachecontrol.html" class="function" rel="rdfs-seeAlso">HttpResponse::getCacheControl</a></b></span></li> <li class="member"> <span class="methodname"><b><b>HttpResponse::getCachel</b></b></span></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.httpresponse-setbuffersize.html">HttpResponse::setBufferSize</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.httpresponse-setcachecontrol.html">HttpResponse::setCacheControl</a></div> <div class="up"><a href="class.httpresponse.html">The HttpResponse</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -