Bug 143020

Summary: [WK2] Responses with 204 HTTP Status Code should be cacheable by default
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, commit-queue, koivisto, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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.