http 标头中的 Last-Modified

发布于 2024-08-25 07:51:24 字数 114 浏览 0 评论 0原文

我请求一个网站标头,但是,此 http 标头中没有“Last-Modified”信息。我想创建一个站点地图并获取服务器上每个文件的日期。不明白为什么有些网站没有此信息。某些软件(例如 Xenu)如何获取文件的日期。

I request a website header, however, there is not Last-Modified info in this http header. I wanna creat a site map and get each file's date on the server. Don't understand why there is not this info for some websites. How did some softwares, such as Xenu, get the file's date.

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

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

发布评论

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

评论(1

白芷 2024-09-01 07:51:24

正如 Johannes Rössel 在对您的问题的评论中指出的那样,Last-Modified 标头不是强制性的。如果存在,您可以像任何其他 HTTP 标头一样读取它(确切的方法取决于您的确切代码,因此在出现代码之前我们无法透露更多信息)。如果不存在,您将无法读取它。就这么简单。除非远程服务器提供此类信息,否则您无法获取有关远程资源的信息。这对于 HTTP 和大多数其他网络协议都有效。

As Johannes Rössel points in his comment to your question, the Last-Modified header is not compulsory. If it is there, you can read it just like any other HTTP header (the exact method depends on your exact code so we can't say more until there's code). If it isn't there, you can't read it. It's as simple as that. You can't fetch information about remote resources unless the remote server provides such piece of info. That's valid for HTTP and most other network protocols.

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