Re: #290 [was: SHOULD-level requirements in p6-caching]

On 05/05/2011, at 9:21 AM, Roy T. Fielding wrote:

> On May 4, 2011, at 5:39 AM, Mark Nottingham wrote:
>> On 04/05/2011, at 9:03 PM, Poul-Henning Kamp wrote:
>> 
>>> In message <783761BA-5934-4621-8908-9A13EE60FB90@mnot.net>, Mark Nottingham wri
>>> tes:
>>> 
>>>> So, I'm reluctant to repeat requirements, because we have good reason to =
>>>> believe that it makes the spec worse, not better.
>>> 
>>> I think simply adding:
>>> 
>>> 	If there is a Cache-Control header, the Pragma header is ignored.
>>> 
>>> Would clarify it even more.
>> 
>> That's not clarifying, that's changing.
> 
> That is what Cache-Control was intended to do.  It replaced Pragma.
> If Pragma isn't ignored when CC is present then refinements to its
> behavior can't be implemented via CC extensions.


Right, but the way that you'd do that is by refining CC: no-cache explicitly, rather than relying on a general header override.*

E.g. if I want to define CC: mnot-cacheok in requests to allow enlightened caches to serve a response, while still disallowing unenlightened caches from doing so, I'd define it to override CC: no-cache -- with the side effect of overriding Pragma: no-cache (because they're defined to be equivalent).

Thus, 

GET /foo HTTP/1.1
Host: example.com
Cache-Control: mnot-cacheok
Pragma: no-cache

would have unambiguous semantics to any cache that sees it, and would properly operate.

AFAICT the only reason that you'd way to say that the Cache-Control header's presence means that you can ignore Pragma is if you want to emit requests like this:

GET /foo HTTP/1.1
Host: example.com
Cache-Control: max-age=45
Pragma: no-cache

and have them treated differently by caches that understand CC vs. those that don't. As I've said a few times now, according to the spec, that's currently very clearly equivalent to:

GET /foo HTTP/1.1
Host: example.com
Cache-Control: max-age=45, no-cache

Which I *hope* we can agree should be interpreted conservatively.

If we remove that equivalence and say that Pragma is ignored in the presence of CC, then we'll have situations where *all* CC directives -- whether they intend it or not -- will override the no-cache, and IMO that's a very surprising outcome.

Cheers,


* This makes me realise, however, that the rules in p6 2.1 and p6 2.2 need to allow extensions to override caching semantics in more places. Opening issue <http://trac.tools.ietf.org/wg/httpbis/trac/ticket/291>. 



--
Mark Nottingham   http://www.mnot.net/

Received on Thursday, 5 May 2011 01:22:12 UTC