html - 如何查找网页上次更新的时间

标签 html upload

有没有办法查明网页更改后经过了多长时间?

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

有没有办法查明这个 HTML 页面是什么时候上传到服务器的?

我无法访问服务器;只是网页的链接。

最佳答案

不,您不能仅仅通过访问页面就知道页面上次更新或上次更改或上传到服务器的时间(根据解释,这可能是三件不同的事情)。

服务器可以并且应该(根据 HTTP 1.1 协议(protocol))发送 Last-Modified header ,您可以通过多种方式找到它,例如使用 Rex Swain’s HTTP Viewer .然而,按照协议(protocol),这只是

“the date and time at which the origin server believes the variant was last modified”.

协议(protocol)实际上添加了:

“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.”

在实践中,网页通常是从内容管理系统或其他方式动态创建的,在这种情况下,Last-Modified header 通常显示创建响应的数据戳,即通常非常接近请求的时间。这意味着 header 在这种情况下实际上是无用的。

即使在“静态”页面的情况下(服务器简单地选择一个与请求匹配的文件并发送它),Last-Modified 日期戳通常只表示最后一次写入访问服务器上的文件。这可能与文件从备份副本恢复的时间有关,或者文件在服务器上编辑时未对内容进行任何更改的时间,或者文件上传到服务器的时间,可能会替换旧的相同的副本。在这些情况下,假设时间戳在技术上是正确的,它表示页面未更改的时间(但不一定是上次更改的时间)。

关于html - 如何查找网页上次更新的时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23644436/

相关文章:

javascript - 固定 div 在向左滚动的 Css 上消失

html - iPhone 上的响应式 View

php - 使用 php 将图像上传到磁盘并在 mysql 数据库中保存图像名称

javascript - 从匿名用户使用javascript将文件上传到Google驱动器

javascript - 如何使用 Javascript 更改背景颜色?

html - 如何在 Bootstrap 缩略图列表中创建 Bootstrap 列

html - 仅适用于手机的视口(viewport)

php - Dailymotion API 上传速率限制

python - 我需要一个 super 简单的 CGI Python 照片上传

iphone - 从 iPhone 上传文件时的进度