HttpWebResponse LastModified [英] HttpWebResponse LastModified
问题描述
HttpWebResponse.LastModified准确吗?它总是存在吗?我的项目是创建一种专注的网络爬虫,如果我将使用资源的哈希值或仅使用HttpWebResponse.LastModified属性检查资源的新鲜度,我就会陷入困境。
Is the HttpWebResponse.LastModified accurate? Is it always present? My project is to create a sort of a focused web crawler and I am stucked if I will use the hash value of a resource or just the HttpWebResponse.LastModified property to check the resource's "freshness".
使用哈希值意味着每次检查时都会流式传输资源。这对整体性能有很大影响。
Using the hash value means streaming the resource every time it's checked. This has a big impact on overall performance.
如果我只检查HttpWebResponse.LastModified,它是否准确?
If I will just check the HttpWebResponse.LastModified, is it accurate?
推荐答案
HttpWebResponse.LastModified返回HTTP Last-Modified
响应标头的值。
HttpWebResponse.LastModified returns the value of the HTTP Last-Modified
response header.
HTTP响应标头由发送响应的HTTP服务器设置。如果它设置 Last-Modified
响应标头,并且是否将其设置为准确值,则完全取决于服务器。
HTTP response headers are set by the HTTP server sending the response. It's completely up to the server if it sets the Last-Modified
response header, and whether it sets it to an accurate value or not.
Last-Modified
响应标头是HTTP中缓存验证模型的一部分。它通常与 If-Modified-Since
请求标头一起使用。您可能需要阅读 HTTP / 1.1,第6部分:缓存了解详情。
The Last-Modified
response header is part of the Validation Model for Caching in HTTP. It is usually used in conjunction with the If-Modified-Since
request header. You might want to read HTTP/1.1, part 6: Caching for the details.
这篇关于HttpWebResponse LastModified的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!