为什么默认缓存过期标头是 Thu, 01 Dec 1994 16:00:00 GMT?这个日期有什么重要意义呢?

发布于 2024-09-25 12:06:32 字数 247 浏览 2 评论 0原文

当通过 WebSphere 应用程序服务器处理某些请求时,它会设置一个缓存过期标头,时间为 Thu, 01 Dec 1994 16:00:00 GMT。该日期似乎在很多文档中作为过期标头的正确形成日期的示例,但在实际响应方面,它也遍布互联网。这个确切的日期(Thu, 01 Dec 1994 16:00:00 GMT)源自哪里?

当您执行 response.setHeader("Expires",0) 时会发生这种情况吗?这是默认值吗?

When some requests are processed via WebSphere application server, it sets a cache expires header of Thu, 01 Dec 1994 16:00:00 GMT. This date seems to be in a lot of documentation as a example of a properly formed date for an expires header, but it is also all over the internet in regards to actual responses. Where does this exact date (Thu, 01 Dec 1994 16:00:00 GMT) originate from?

Is this what happens when you do response.setHeader("Expires",0) is this the default value?

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

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

发布评论

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

评论(2

猫卆 2024-10-02 12:06:32

我认为除了 RFC 中的“到期”日期示例之外,没有任何特殊意义1945 年:超文本传输​​协议 - HTTP/1.0,日期为 1996 年 5 月。至少有一些文本写得更早,实际上是 RFC 1738:统一资源定位器 (URL ) 的日期为 1994 年 12 月。

在撰写本文时,它是一个合理的示例值。同样,RFC“Tue, 15 Nov 1994 08:12:31 GMT”中的“date”标头示例在网络中很流行。这两个值一起构成一个一致的示例。

在 RFC 1945 中没有提到特定的默认值,但它指出

注意:鼓励申请
容忍坏事或
Expires 标头的错误实现。值为零
(0) 或无效的日期格式应被视为等同于
“立即过期”。虽然这些值不是
合法的
对于 HTTP/1.0,健壮的实现始终是可取的。

服务器的实现者将阅读 RFC——他们需要阅读 RFC 才能知道要实现什么——并选择给出的示例日期并使用它。

I don't think there is any particular significance, beyond its appearing as the example 'expires' date in RFC 1945: Hypertext Transfer Protocol -- HTTP/1.0 dated May 1996. At least some of the text would have been written much earlier, indeed RFC 1738: Uniform Resource Locators (URL) is dated December 1994.

At the time of writing it would have been a reasonable example value. In the same way the 'date' header example in the RFC 'Tue, 15 Nov 1994 08:12:31 GMT', is prevalent in the web. The two values together form a consistent example.

In RFC 1945 there's no mention of a specific default value, however it states

Note: Applications are encouraged to
be tolerant of bad or
misinformed implementations of the Expires header. A value of zero
(0) or an invalid date format should be considered equivalent to
an "expires immediately." Although these values are not
legitimate
for HTTP/1.0, a robust implementation is always desirable.

Implementors of servers will have read the RFC - they'd need to in order to know what to implement - and picked up the example date given, and used it.

幸福%小乖 2024-10-02 12:06:32

您可以查看这30秒来了解为什么会这样。它基本上是技术文档中的复制和粘贴值。

You can check this 30 seconds to see why it is like that. It's basically copy and pasted value from technical documentation.

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