如何查找网页上次更新的时间? [英] How do I find when a web page was last updated?

查看:200
本文介绍了如何查找网页上次更新的时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



例如,
我有一个页面托管在: www.mywebsitenotupdated.com



有没有办法找出这个html页面何时上传到服务器?

非常重要的是,我无法访问服务器;只是指向网页的链接。

解决方案

不,您无法知道网页上次更新或上次更改的时间,上传到一个服务器(这可能,这取决于解释,是三种不同的东西),只需访问该页面。



服务器可能,也应该(根据HTTP 1.1协议),发送 Last-Modified 标题,您可以通过多种方式找到它们,例如使用 Rex Swain的HTTP查看器。但是,根据协议,这只是原始服务器认为变体最后修改的日期和时间。协议实际上增加了:这个头域的确切含义取决于原始服务器的实现和原始资源的性质。对于文件,它可能只是文件系统上次修改时间。对于具有动态包含部分的实体,它可能是其组成部分的最后修改时间的最近一次。对于数据库网关,它可能是记录的最后更新时间戳记。对于虚拟对象,它可能是内部状态最后一次改变。



实际上,网页通常是从内容管理系统或其他方式动态创建的,并且在这种情况下, Last-Modified 头部通常会显示创建响应的数据标记,通常与请求时间非常接近。这意味着头部在这种情况下几乎没有用处。

即使在静态页面的情况下(服务器只需拾取一个匹配请求的文件并发送它), Last-Modified 日期标记通常表示对服务器上文件的最后一次写入访问。这可能与文件从备份副本中恢复的时间有关,也可能与文件在服务器上进行编辑而未对内容进行任何更改的时间或与将文件上载到服务器上的时间相关,可能会替换旧版本相同的副本。在这些情况下,假设时间戳在技术上是正确的,它表示一段时间之后页面没有被改变(但不一定是最后一次改变的时间)。


Is there a way to find out how much time has passed since a web page was changed?

For example, I have a page hosted at: www.mywebsitenotupdated.com

Is there a way to find out when this html page was uploaded to server?

Very important, I have no access to server; just a link to webpage.

解决方案

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.

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 "the date and time at which the origin server believes the variant was last modified". And the protocol realistically adds: "The exact meaning of this header field depends on the implementation of the origin server and the nature of the original resource. For files, it may be just the file system last-modified time. For entities with dynamically included parts, it may be the most recent of the set of last-modify times for its component parts. For database gateways, it may be the last-update time stamp of the record. For virtual objects, it may be the last time the internal state changed."

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.

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).

这篇关于如何查找网页上次更新的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆