问题描述
有没有一种方法可以找出自更改网页以来已经过去了多少时间?
Is there a way to find out how much time has passed since a web page was changed?
例如,我的网页托管在:www.mywebsitenotupdated.com
For example,I have a page hosted at: www.mywebsitenotupdated.com
是否有办法确定何时将该HTML页面上载到服务器?
Is there a way to find out when this HTML page was uploaded to the server?
我无权访问服务器;只是指向网页的链接.
推荐答案
不,您不知道页面的最后更新时间或最后更改时间或上载到服务器的时间(根据解释的不同,这可能是三种不同的东西)而已通过访问该页面.
No, you cannot know when a page was last updated or last changed or uploaded to a server (which might, depending on interpretation, be three different things) just by accessing the page.
服务器可以并且应该(根据HTTP 1.1协议)发送 Last-Modified
标头,您可以通过多种方式查找标头,例如使用雷克斯·斯温的HTTP查看器.但是,根据协议,这只是
A server may, and should (according to the HTTP 1.1 protocol), send a Last-Modified
header, which you can find out in several ways, e.g. using Rex Swain’s HTTP Viewer. However, according to the protocol, this is just
该协议实际上添加了:
实际上,通常是从内容管理系统或其他方式动态创建网页,在这种情况下,Last-Modified
标头通常会显示创建响应的数据戳记,通常与响应时间非常接近.请求.这意味着在这种情况下,标头实际上是无用的.
In practice, web pages are very often dynamically created from a Content Management System or otherwise, and in such cases, the Last-Modified
header typically shows a data stamp of creating the response, which is normally very close to the time of the request. This means that the header is practically useless in such cases.
即使在静态"页面的情况下(服务器只是简单地提取与请求相匹配的文件并发送),Last-Modified
日期戳通常仅指示对服务器上文件的最后一次写访问.这可能与从备份副本还原文件的时间有关,或者与在服务器上编辑文件而不对内容进行任何更改的时间有关,或者与文件上载到服务器的时间(可能替换了较旧的文件)有关.相同的副本.在这些情况下,假设时间戳在技术上是正确的,则它表示未更改页面的时间(但不一定是最后一次更改的时间).
Even in the case of a "static" page (the server simply picks up a file matching the request and sends it), the Last-Modified
date stamp normally indicates just the last write access to the file on the server. This might relate to a time when the file was restored from a backup copy, or a time when the file was edited on the server without making any change to the content, or a time when it was uploaded onto the server, possibly replacing an older identical copy. In these cases, assuming that the time stamp is technically correct, it indicates a time after which the page has not been changed (but not necessarily the time of last change).
这篇关于如何查找网页的最新更新时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!