W3C home > Mailing lists > Public > ietf-http-wg@w3.org > April to June 2011

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

From: Mark Nottingham <mnot@mnot.net>
Date: Thu, 5 May 2011 13:04:53 +1000
Cc: Poul-Henning Kamp <phk@phk.freebsd.dk>, HTTP Working Group <ietf-http-wg@w3.org>
Message-Id: <F9987D95-7E2D-4858-9F45-995D49B94D37@mnot.net>
To: "Roy T. Fielding" <fielding@gbiv.com>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 06:51:40 GMT