If-Modified-Since

  参考: If-Modified-Since

14.25 If-Modified-Since

The If-Modified-Since request-header field is used with a method to make it conditional: if the requested variant has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message-body.

       If-Modified-Since = "If-Modified-Since" ":" HTTP-date

An example of the field is:

       If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT

A GET method with an If-Modified-Since header and no Range header requests that the identified entity be transferred only if it has been modified since the date given by the If-Modified-Since header. The algorithm for determining this includes the following cases:

      a) If the request would normally result in anything other than a
         200 (OK) status, or if the passed If-Modified-Since date is
         invalid, the response is exactly the same as for a normal GET.
         A date which is later than the server's current time is
         invalid.
      b) If the variant has been modified since the If-Modified-Since
         date, the response is exactly the same as for a normal GET.
      c) If the variant has not been modified since a valid If-
         Modified-Since date, the server SHOULD return a 304 (Not
         Modified) response.

The purpose of this feature is to allow efficient updates of cached information with a minimum amount of transaction overhead.

      Note: The Range request-header field modifies the meaning of If-
      Modified-Since; see section 14.35 for full details.
      Note: If-Modified-Since times are interpreted by the server, whose
      clock might not be synchronized with the client.
      Note: When handling an If-Modified-Since header field, some
      servers will use an exact date comparison function, rather than a
      less-than function, for deciding whether to send a 304 (Not
      Modified) response. To get best results when sending an If-
      Modified-Since header field for cache validation, clients are
      advised to use the exact date string received in a previous Last-
      Modified header field whenever possible.
      Note: If a client uses an arbitrary date in the If-Modified-Since
      header instead of a date taken from the Last-Modified header for
      the same request, the client should be aware of the fact that this
      date is interpreted in the server's understanding of time. The
      client should consider unsynchronized clocks and rounding problems
      due to the different encodings of time between the client and
      server. This includes the possibility of race conditions if the
      document has changed between the time it was first requested and
      the If-Modified-Since date of a subsequent request, and the
      possibility of clock-skew-related problems if the If-Modified-
      Since date is derived from the client's clock without correction
      to the server's clock. Corrections for different time bases
      between client and server are at best approximate due to network
      latency.

The result of a request having both an If-Modified-Since header field and either an If-Match or an If-Unmodified-Since header fields is undefined by this specification. 



ajax缓存--("If-Modified-Since","0") - haochangjun的专栏 - ...
if(window.XMLHTTPRequest){ xmlHTTP = new XMLHTTPRequest(); }}function getHTMLinfo(URL){ createXMLHTTP(); xmlHTTP.open("get", URL, true); xmlHTTP.onreadystatechange = callHTML; xmlHTTP.setRequestHeader("If-Modified-Since...
blog.csdn.net/haochangjun/archive/2008/06 ... 19K 2008-6-30 - 百度快照

http1.1---9 - xzjxu的专栏 - CSDNBlog
If-Modified-Since The If-Modified-Since request-header field is used with the GET method to make it ...If-Modified-Since = "If-Modified-Since" ":" HTTP-date An example of the field is: If-Modified-Since: ...
blog.csdn.net/xzjxu/archive/ ... /6648.aspx 60K 2008-4-3 - 百度快照

关于浏览器的缓存和getLastModified()的使用问题。 - hnsc的专栏 ..
如果getLastModified方法的返回值是一个正数,并且客户端的请求消息中没有包含If-Modified-Since头字段的(这种情况是第一次访问该页面时)或者是请求消息中包含If-Modified-Since头字段,但是返回值比If-Modified-Since头字段指定的时间新的话,...
blog.csdn.net/hnsc/archive/ ... /1414316.aspx 16K 2008-5-26 - 百度快照

Scott Mitchell 的ASP.NET 2.0数据教程之第55: 在Data Web控件...
GETs,这样的话,客户端使HTTP请求发送一个If-Modified-Since HTTP header。If-Modified-Since HTTP header包含了客户端...关于If-Modified-Since header和conditional GET的详细信息请参阅文章《 HTTP Conditional GET for RSS Hackers 》和《...
blog.csdn.net/heker2007/archive/2007/04/0 ... 58K 2007-5-15 - 百度快照

浏览器缓存内幕与getLastModified方法 - Andrew Wang的专栏 - CSD..
只有文档的修改时间比If-Modified-Since请求头指定的时间新时,服务器才会返回文档内容。如果自从If-Modified-Since指定...HttpServlet类为If-Modified-Since请求头和Last-Modified头字段的这种应用提供了处理机制,当继承了HttpServlet类的...
blog.csdn.net/andydevelope/archive/2006/0 ... 43K 2008-5-8 - 百度快照

rfc1945-http1.0自译本-(7) - chifire的专栏 - CSDNBlog
从何时更改(If-Modified-Since) If-Modified-Since请求标题域和GET方法一起使用,用于处理下面情况:当在该域指定的...如果资源在If-Modified-Since日期以后有变化,回应也和普通GET一样 c) 如果资源在If-Modified-Since日期以后没变化,...
blog.csdn.net/chifire/archive/ ... /3749.aspx 89K 2008-5-15 - 百度快照

web开发中的缓存问题的研究(二) - 海蓝蓝的专栏 - CSDNBlog
只有文档的修改时间比If-Modified-Since请求头指定的时间新时,服务器才会返回文档内容。如果自从If-Modified-Since指定...HttpServlet类为If-Modified-Since请求头和Last-Modified头字段的这种应用提供了处理机制,当继承了HttpServlet类的...
blog.csdn.net/hailanlan1223/archive/2006/ ... 23K 2008-5-25 - 百度快照

Servlet学习 - 学而不思则罔, 思而不学则殆 - CSDNBlog
当getLastModified方法返回一个正数,且请求消息中没有包含If-Modified-Since,或者请求消息的If-Modified-Since中的时间值比getLastModified方法返回的时间值旧时,service调用doGet方法。 3. getLastModified返回值与If-Modified-Since时间值相同或...
blog.csdn.net/lybra/archive/2008/03/16/21 ... 29K 2008-3-31 - 百度快照

web开发中的缓存问题的研究 - 绯红游侠 - CSDNBlog
只有文档的修改时间比If-Modified-Since请求头指定的时间新时,服务器才会返回文档内容。如果自从If-Modified-Since指定...HttpServlet类为If-Modified-Since请求头和Last-Modified头字段的这种应用提供了处理机制,当继承了HttpServlet类的...
blog.csdn.net/yangjiyue/archive/2007/12/0 ... 37K 2008-6-21 - 百度快照

HTTP 协议学习笔记 - 西门吹雪的专栏 - CSDNBlog
If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT If-Modified-Since请求标题域和GET方法一起使用,用于处理下面情况:当在该域指定的日期以来,请求资源没有 发生任何变更。这时,服务器将不会下传该资源的拷贝,即,回应不带任何...
blog.csdn.net/zhaokugua/archive/2008/05/2 ... 26K 2008-6-6 - 百度快照


什么函数库可以把HTTP应答的“Last-Modified: Wed, 03 Sep 2008 05:12:12 GMT”这样的日期格式转化为COleDateTime或其他数据格式也可以。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值