Subject: RE: i107

From: "Brian Smith" <[email-masked]>
Date: Wed, 27 Feb 2008 21:53:35 -0800

> Last-Modified validation is defined in terms of
> 'requested variant', whereas ETag validation
> (If-Match, If-None-Match) seem to go out of
> their way to say that *any* entity that meets
> the conditional can be returned, and never
> mind the selecting headers. I'd be interested
> in hearing if any implementations actually do
> that, and unless some are found, I'd suggest
> we need to tighten up how ETag validation is
> defined.

Consider a resource http://example.org/a with two representations, where the server varies the representation based on Accept-Encoding:

Last-Modified: Wed, 15 Nov 1995 06:00:00 GMT
ETag: 1
Content-Type: text/plain
Vary: Accept-Encoding

Last-Modified: Wed, 15 Nov 1995 12:00:00 GMT
ETag: 2
Content-Type: text/plain
Content-Encoding: 
Vary: Accept-Encoding

Now, consider the following requests. What is the best status code, and which entity (if any), ETag, and Last-Modified should be returned for each request?

(a) GET http://example.org/a HTTP/1.1
    If-None-Match: 1
    Accept-Encoding: deflate

    HTTP/1.1 304 Not Modified
    ETag: 2
    Vary: Accept-Encoding

(b) GET http://example.org/a HTTP/1.1
    If-None-Match: 1
    Accept-Encoding: deflate;q=0

    HTTP/1.1 304 Not Modified
    ETag: 1
    Vary: Accept-Encoding

(c) GET http://example.org/a HTTP/1.1
    If-None-Match: 2
    Accept-Encoding: deflate

    HTTP/1.1 304 Not Modified
    ETag: 2
    Vary: Accept-Encoding

(d) GET http://example.org/a HTTP/1.1
    If-None-Match: 2
    Accept-Encoding: deflate;q=0

    HTTP/1.1 304 Not Modified
    ETag: 1
    Vary: Accept-Encoding

(e) GET http://example.org/a HTTP/1.1
    If-None-Match: nothing-matches-this
    Accept-Encoding: deflate

    HTTP/1.1 200 OK
    ETag: 2
    Vary: Accept-Encoding

    (the response entity is variant 2)

(f) GET http://example.org/a HTTP/1.1
    If-None-Match: nothing-matches-this
    Accept-Encoding: deflate;q=0

    HTTP/1.1 200 OK
    ETag: 2
    Vary: Accept-Encoding

    (the response entity is variant 1)

Now, make the following substitutions:

* replace: "If-None-Match: 1"
  with:    "If-Unmodified-Since: Wed, 15 Nov 1995 06:00:00 GMT"

* replace: "If-None-Match: 2"
  with:    "If-Unmodified-Since: Wed, 15 Nov 1995 12:00:00 GMT"

* replace: "If-None-Match: nothing-matches-this"
  with:    "If-Unmodified-Since: Wed, 15 Nov 1995 00:00:00 GMT"

What should the results be? I believe they should be exactly the same as the ones I gave above, except (a) and (b) MAY return the same results as (e) and (f), since one of the variants was modified since the given time ("Wed, 15 Nov 1995 06:00:00 GMT").

I think this demonstrates that If-[Un]modified-Since validation needs to be changed to be more like the current ETag validation, and not the other way around.

- Brian

---

From: "Brian Smith" <[email-masked]>
Date: Wed, 27 Feb 2008 22:11:24 -0800

> Last-Modified: Wed, 15 Nov 1995 12:00:00 GMT

Obviously, the second variant is supposed to have "Content-Encoding: deflate".

- Brian