mnot / I-D

My Internet-Drafts
https://mnot.github.io/I-D/
Other
98 stars 38 forks source link

Few minor tweaks #323

Closed jasnell closed 3 years ago

jasnell commented 3 years ago

Just a couple copy edits, otherwise it looks good with a comment...

In the good case, where trailer-update is indicated in the header Cache-Control but no subsequent trailing Cache-Control is provided:

HTTP/1.1 200 OK
Content-Type: text/html
Cache-Control: max-age=3600, trailer-update

[body]

It says that "Caches that do not implement this specification will cache it by the header policy; caches that do implement will see no updates in the trailer and do the same.", but that means that the trailer-update directive does get stored and forwarded on by the cache (since it is never removed). I'm just wanting to make sure there's no unintended down stream consequence from that. We may want to explicitly state that the presence of a trailer-update directive does not mandate that a Cache-Control trailer is present.

The only other thing that I can think of is ... when a trailing Cache-Control directive is received and it contains an updated timestamp (max-stale, expires, etc) ... is there any impact on the origin time from which that is calculated. Let's take an extreme example: I start streaming a resource back from the server with a max-age of 30 seconds. 20 seconds later the resource is done streaming and I update the Cache-Control with a max-age of 10 seconds.... Is the resource already stale (age calculated from the time the resource started to be received) or is the age calculated from the time the Cache-Control was updated and the resource was committed to the cache? Or does that not even matter here.

mnot commented 3 years ago

Thanks.

I agree re: stating that trailer-update does not mandate a trailer; will refine it along those lines.

WRT the time delta - good point. HTTP is a bit fuzzy about this, effectively treating the entire response as atomic. I feel like a reasonable default is that if the trailer updates cache-control, the time the response is received should be considered to be that point, because that's closest to when the policy was actually generated.

jasnell commented 3 years ago

I feel like a reasonable default is that if the trailer updates cache-control, the time the response is received should be considered to be that point, because that's closest to when the policy was actually generated.

Agreed.

mnot commented 3 years ago

Looking at age calcluation, it's a little more subtle than that. I think we need to say that for the purposes of calculating resident_time, response_time should be considered to be the time the trailer was received; however, for the purposes of calculating response_delay for corrected_age_value, that would be counter-productive.

jasnell commented 3 years ago

Hmm yeah... That's what had me thinking, thank you for looking that up. I think the likely safest thing to do is to simply say that the trailing Cache-Control has no impact on the age calculation, and that even with an updated Cache-Control, the age is calculated the same as it would be without the trailer. It's the only way we're going to be able to make it consistent with non-implementing endpoints and keep things simple.