为什么是“过期”? 1981 年?

发布于 2024-12-17 03:31:18 字数 380 浏览 2 评论 0原文

我的 CRON 作业返回了一个错误,指出 CRON 作业不起作用。就在那里:

Set-Cookie: PHPSESSID=2t2drultihqci4em15nbfmeb63; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-type: text/html

我想知道为什么 Expires 设置为“1981”。有什么意义呢?

My CRON Job returned an error that CRON job did not work. In that this was there:

Set-Cookie: PHPSESSID=2t2drultihqci4em15nbfmeb63; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-type: text/html

I am wondering why is Expires set to "1981". What is the significance?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

风轻花落早 2024-12-24 03:31:18

这是禁用缓存的尝试。

该日期是添加代码的开发人员 Sascha Schumann 的生日。

来自会话.c:

Authors: Sascha Schumann <[email protected]> 
         Andrei Zmievski <[email protected]> 

// ...

CACHE_LIMITER_FUNC(private)
{
    ADD_HEADER("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
    CACHE_LIMITER(private_no_expire)(TSRMLS_C);
}

It's an attempt to disable caching.

The date is the birthday of the developer Sascha Schumann who added the code.

From session.c:

Authors: Sascha Schumann <[email protected]> 
         Andrei Zmievski <[email protected]> 

// ...

CACHE_LIMITER_FUNC(private)
{
    ADD_HEADER("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
    CACHE_LIMITER(private_no_expire)(TSRMLS_C);
}
满地尘埃落定 2024-12-24 03:31:18

HTTP 过期标头

http://www.w3.org/Protocols/rfc2616/rfc2616- sec13.html

设置为负数或过去的值,以防止缓存响应。

这个标头的用法很常见。

HTTP Expires header

http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html

It is set to negative or past value, to prevent caching of response.

Quite common usage of this header.

给不了的爱 2024-12-24 03:31:18

我认为您在调用 session_start 之前使用了 session_cache_limiter。如果参数是 privateno-cache,结果是将 Expires 标头设置为您提到的时间。请参阅文档了解更多信息。

I think you are using session_cache_limiter before calling session_start. If argument is private or no-cache the result is setting the Expires header to the time you have mentioned. Refer to this document for more information.

想你只要分分秒秒 2024-12-24 03:31:18

有人只是将 expires = date('-30years') (解释)放入他的代码中,以确保内容被设置为过期且不被缓存。

Somebody just put expires = date('-30 years') (paraphrased) in his code to make really sure the content is set as expired and not cached.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文