Subject: p2 / p6: What is "cacheable"?

From: Mark Nottingham <[email-masked]>
Date: Mon, 29 Apr 2013 22:17:05 +1000

p2 4.2.3 defines a method's cacheability as:

> Request methods are considered "cacheable" if it is possible and useful to answer a current client request with a stored response from a prior request. GET and HEAD are defined to be cacheable. In general, safe methods that do not depend on a current or authoritative response are cacheable, though the overwhelming majority of caches only support GET and HEAD. HTTP requirements for cache behavior and cacheable responses are defined in[Part6].

However, p6 section 3 prohibits caches from storing a response unless

> The request method is understood by the cache and defined as being cacheable

These seem to be incompatible; p2's "method cacheability" is defined in terms of whether a previously stored response can be used to satisfy the current request method, whereas p6 defines it in terms of whether responses to the method can be stored for future use.

The p6 definition (perhaps unsurprisingly) makes the most sense to me, and I think we should align that in p2 with it, adjusting the text in the methods themselves if required. 

We also seem to have a number of different types of cacheability defined right now; there's method cacheability, status code cacheability, and overall response cacheability.

While we could invent some new terms (e.g., pressing "storability" into service), I think we could improve things by just using "cacheable method", "cacheable status" and "cacheable response" consistently throughout the specs.

Finally, p2's section on status codes buries this at the end of 6.1 (under a large table):

> Responses with status codes that are defined as cacheable by default (e.g., 200, 203, 206, 300, 301, and 410 in this specification) can be reused by a cache with heuristic expiration unless otherwise indicated by the method definition or explicit cache controls [Part6]; all other status codes are not cacheable by default.

This should be moved up (and changed to "cacheable status" as per above).

I think this issue is editorial, unless there's disagreement over what method cacheability is (Roy?)

Cheers,

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