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

On 05/05/2011, at 12:32 PM, Roy T. Fielding wrote:

>> """
>> When the no-cache pragma directive is present in a request, a cache MUST treat the request as if it contains the no-cache cache-control directive [ref], unless the Cache-Control header is also present in the request. 
>> 
>> A client SHOULD include both pragma and cache-control directives when sending a no-cache request , unless Cache-Control: no-cache is omitted to target other Cache-Control directives at HTTP/1.1 caches, while precluding HTTP/1.0 implementations from using a cached response.
>> """
>> 
>> Is that workable?
> 
> Sounds like torture to me.  What is wrong with just ignoring Pragma
> if Cache-Control is given and obeyed?


"Obeyed" really needs to be qualified to those directives that are understood. I've have a go below; if you have suggestions, please provide specific text.

"""
3.4.  Pragma

The "Pragma" header field allows backwards compatibility with HTTP/1.0 caches, so that clients can specify a "no-cache" request that they will understand (as Cache-Control was not defined until HTTP/1.1). When the Cache-Control header is also present and understood in a message, Pragma is ignored. 

In HTTP/1.0, Pragma was defined as an extensible field for implementation-specified directives for recipients. This specification deprecates such extensions to improve interoperability. 

     Pragma           = 1#pragma-directive
     pragma-directive = "no-cache" / extension-pragma
     extension-pragma = token [ "=" ( token / quoted-string ) ]

When the no-cache pragma directive is present in a request, a cache MUST treat the request as if it contains the no-cache cache-control directive [ref], unless the Cache-Control header is also present and the cache obeys those cache-control directives [ref] that it contains (excepting any extensions that are not understood [ref]). 

A client SHOULD include both pragma and cache-control directives when sending a no-cache request, unless Cache-Control: no-cache is purposefully omitted to target other Cache-Control response directives at HTTP/1.1 caches. For example:

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

will constrain HTTP/1.1 caches to serve a response no older than 30 seconds, while precluding implementations that do not understand Cache-Control from serving a cached response.
"""

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

Received on Thursday, 5 May 2011 03:05:21 UTC