Subject: 304 and Age

From: Thomas Fossati <[email-masked]>
Date: Mon, 8 Oct 2012 14:04:22 +0000

Hi all,

maybe a dumb one, but I couldn't find any decisive anchor for the following question: suppose my cache receives a conditional GET for a resource for which it has a fresh representation, should Age be sent back to the requester in a 304 ?

The two points in the current spec that got me confused are:

- p6, Section 4: "When a stored response is used to satisfy a request without validation, a cache MUST include a single Age header field in the response with a value equal to the stored response's current_age."

- p4, Section 4.1 after the paragraph listing the mandatory headers for 304 (which do not include Age): "Since the goal of a 304 response is to minimize information transfer when the recipient already has one or more cached representations, the response should not include representation metadata other than the above listed fields unless said metadata exists for the purpose of guiding cache updates (e.g., future HTTP extensions)."

TIA, Thomas.

---

From: Amos Jeffries <[email-masked]>
Date: Tue, 09 Oct 2012 13:01:53 +1300

On 09.10.2012 03:04, Thomas Fossati wrote:
> Hi all,
>
> maybe a dumb one, but I couldn't find any decisive anchor for the
> following question: suppose my cache receives a conditional GET for a
> resource for which it has a fresh representation, should Age be sent
> back to the requester in a 304 ?
>
> - p6, Section 4: "When a stored response is used to satisfy a request
> without validation, a cache MUST include a single Age header field in
> the response with a value equal to the stored response's 
> current_age."
>
> - p4, Section 4.1 after the paragraph listing the mandatory headers
> for 304 (which do not include Age): "Since the goal of a 304 response
> is to minimize information transfer when the recipient already has 
> one
> or more cached representations, the response should not include
> representation metadata other than the above listed fields unless 
> said
> metadata exists for the purpose of guiding cache updates (e.g., 
> future
> HTTP extensions)."
>
> TIA, Thomas.

IMO, the Age header is not useful in this case. Since the requestor 
already appears to have a copy of the representation, thus already has 
or can calculate its Age. If the requestor does not already have a coy 
(was checking for existence etc) then it does not need to know Age, but 
only existence and future lifetime - which are included via the other 
304 headers.

AYJ

---

From: Thomas Fossati <[email-masked]>
Date: Tue, 9 Oct 2012 15:05:34 +0000

On 9 Oct 2012, at 01:01, Amos Jeffries wrote:
>> the response with a value equal to the stored response's current_age."
>> 
>> is to minimize information transfer when the recipient already has one
>> representation metadata other than the above listed fields unless said
>> metadata exists for the purpose of guiding cache updates (e.g., future
>> HTTP extensions)."
>> 
>> TIA, Thomas.
> 
> IMO, the Age header is not useful in this case. Since the requestor already appears to have a copy of the representation, thus already has or can calculate its Age. If the requestor does not already have a coy (was checking for existence etc) then it does not need to know Age, but only existence and future lifetime - which are included via the other 304 headers.

That seems reasonable, thanks.

The MUST about Age in Section 4 of p6 should then be amended to take care of 304, or am I missing some other point in the spec that already narrows the scope of this requirement ?

---

From: "Eric J. Bowman" <[email-masked]>
Date: Tue, 9 Oct 2012 13:42:18 -0600

Amos Jeffries wrote:
> already appears to have a copy of the representation, thus already
> has or can calculate its Age.
>

Sure, if the cache validates with the origin, but what if that isn't
the case?

Client has representation, reloads.  Cache also has representation,
but responds 304 without validating to the origin.  Without Age, how
does client know if the cache's 304 is referring to a newer or older
representation than the one the client already has?

-Eric

---

From: Amos Jeffries <[email-masked]>
Date: Wed, 10 Oct 2012 11:16:42 +1300

> representation than the one the client already has?

Consider how the cache knew to send 304 instead of a 200 with cached 
representation in response to that GET.

The client has to have sent conditional headers to receive that 304, 
which conditionals outlined some form of parameters for the cache to 
select representation and the above statement applies. If the client 
omitted conditional headers on a GET the cache is in error sending a 304 
status - for exactly the reason you point out.

Amos