Bug 143020 - [WK2] Responses with 204 HTTP Status Code should be cacheable by default
Summary: [WK2] Responses with 204 HTTP Status Code should be cacheable by default
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-03-24 14:20 PDT by Chris Dumez
Modified: 2015-03-24 16:46 PDT (History)
4 users (show)

See Also:


Attachments
Patch (6.48 KB, patch)
2015-03-24 14:42 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (8.85 KB, patch)
2015-03-24 16:05 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-03-24 14:20:33 PDT
Responses with 204 HTTP Status Code should be cacheable by default according to RFC 7231:
"""
   A 204 response is cacheable by default; i.e., unless otherwise
   indicated by the method definition or explicit cache controls (see
   Section 4.2.2 of [RFC7234]).
""" [1]

[1] http://tools.ietf.org/html/rfc7231#section-6.3.5

The new WebKit Network cache does not currently cache these, even if Cache-Control headers allow us to do so.
Comment 1 Radar WebKit Bug Importer 2015-03-24 14:21:17 PDT
<rdar://problem/20281529>
Comment 2 Chris Dumez 2015-03-24 14:42:03 PDT
Created attachment 249355 [details]
Patch
Comment 3 Antti Koivisto 2015-03-24 15:10:11 PDT
Comment on attachment 249355 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=249355&action=review

> LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js:46
> -    var testURL = "resources/generate-response.cgi?uniqueId=" + uniqueTestId++ + "&Content-type=text/plain";
> +    var cgi_script = withBody ? "resources/generate-response.cgi" : "resources/generate-response-no-body.cgi";
> +    var testURL = cgi_script + "?uniqueId=" + uniqueTestId++ + "&Content-type=text/plain";

Maybe body generation should just be an argument for the script? Otherwise we need to keep these in sync if we add features.
Comment 4 Chris Dumez 2015-03-24 16:05:28 PDT
Created attachment 249361 [details]
Patch
Comment 5 Chris Dumez 2015-03-24 16:46:46 PDT
Comment on attachment 249361 [details]
Patch

Clearing flags on attachment: 249361

Committed r181920: <http://trac.webkit.org/changeset/181920>
Comment 6 Chris Dumez 2015-03-24 16:46:54 PDT
All reviewed patches have been landed.  Closing bug.