我的 Pragma HTTP 响应标头应设置为什么?
我将与缓存相关的标头设置为在八小时后过期,如下所示...
header('Cache-Control: max-age=28800');
header('Expires:' . gmdate('D, d M Y H:i:s T', strtotime('+8 hours')));
在这种情况下,我的 Pragma HTTP 响应标头应该设置为什么?
I have my cache related headers set to expire at eight hours as follows...
header('Cache-Control: max-age=28800');
header('Expires:' . gmdate('D, d M Y H:i:s T', strtotime('+8 hours')));
With that being the case, what should my Pragma HTTP response header be set to?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不必设置 pragma,仅当您想要无缓存指令时才设置 pragma。请参阅此处以获取更多信息: http://www.w3 .org/Protocols/rfc2616/rfc2616-sec14.html#sec14.32
You don't have to set pragma, pragma is set only if you want a no-cache directive. Have a look here for more information: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.32
请参阅 PHP 文档以了解 session_cache_limiter。您将看到要发送的正确缓存标头:
public:
private_no_expire:
private:
nocache:
See the PHP doc for session_cache_limiter. You will see the correct cache headers to send:
public:
private_no_expire:
private:
nocache: