W3C home > Mailing lists > Public > ietf-http-wg@w3.org > October to December 2009

Which status codes are cacheable?

From: Brian Smith <brian@briansmith.org>
Date: Mon, 12 Oct 2009 20:15:19 -0500
To: "'HTTP Working Group'" <ietf-http-wg@w3.org>
Message-ID: <000301ca4ba2$a3d48700$eb7d9500$@org>
In Part 2, the definitions of 300, 301, 302, 303, 307, and 410 status codes
explicitly state that they are cacheable. However, none of the other status
codes state explicitly whether or not they are cacheable.

Part 6, Section 2.1 (Response Cacheability) doesn't give any restrictions on
storing a response a response based on its status code. By the way it is
written, implicitly a response with any status code may be cached.

I believe Part 6, Section 2.1 needs to be changed to add an extra
requirement analogous to the requirement for method cacheability:

    ...
    * The request method is defined as being cacheable, and
+   * The response is cacheable according to the definition
+      of the response's status code, and
    ...

Explicit statements in each cacheable status code's definition would need to
be added as well.

The following are always cacheable: 200, 203, 204, 205, 300, 301, 410.

I think the following should be cacheable only when an appropriate Expires
or Cache-Control are present: 302, 303, 307, 401, 403, 404, 405, 406, 500,
501, 502, 503, 504, 505.

I am not sure about the other status codes, but I believe that the following
should probably never be cached: 201, 202, 305, 306, 402, 408, 409, 411,
412, 413, 415, 417.

Regards,
Brian
Received on Tuesday, 13 October 2009 01:15:53 GMT

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