2

What is the difference between if-modified-since and unless-modified-since (http headers)? What web server response should we send to this? IE9 is requesting the unless-modified-since header which we are unfamiliar with.

Most of my research pushes is leading towards the if-modified-since header. My understanding is that the unless-modified-since header is IE specific.

You can go to this link: https://i.stack.imgur.com/nacRF.jpg to see the screen shot of the request header.

849486748
  • 103
  • 1
  • 5

2 Answers2

2

There is no such HTTP header as Unless-Modified-Since[list]. It doesn't even make sense: why would you need to retrieve a resource only if it's the same as the version you already know about?

If-Modified-Since is used to fetch a resource only if it's newer that the version the browser already knows about. If it hasn't been modified since the given time, the server will not send it, and the browser will get it from its cache instead.

See also If-Match and If-None-Match. Those are a more flexible pair of headers that can be used to instruct the server to only carry out an operation based on various combinations of the resource already existing, not already existing, or existing with one or more particular versions. They are based on the resource's ETag instead of last modified timestamp. This question has more detail about using the last modified time vs. the etag.

Community
  • 1
  • 1
Celada
  • 21,627
  • 4
  • 64
  • 78
  • 1
    Seems like a non-standard extension header, perhaps understood by only the one specific HTTP server implementation it's designed to be sent to. The closest similar thing I can find as a standard is `If-Unmodified-Since` in [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html) and that's not very useful in a GET request. – Celada Mar 15 '13 at 14:38
0

Unless-Modified-Since was proposed in a draft for the Range extension/feature of HTTP.

According to the draft, the idea was that a client can send a Range request with a Unless-Modified-Since header and the server/cache would return the range, unless the file was modified since that date, in which case the server/cache would return the entire file instead. (This might be useful for say resuming a download - if the file was not modified, it can continue, if it was it would restart)

If-Range is the standard alternative (It is the same, but will take ETags as well).

If-Modified-Since is relevant for full requests.

If-Unmodified-Since can make the request fail, instead of returning the full file (which If-Range would do) if it changed

Gert van den Berg
  • 2,448
  • 31
  • 41