⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181904 in webkit


Ignore:
Timestamp:
Mar 24, 2015, 1:42:20 PM (11 years ago)
Author:
Chris Dumez
Message:

[WK2] Responses with 404 HTTP Status Code should be cacheable by default
https://bugs.webkit.org/show_bug.cgi?id=143014
<rdar://problem/20280310>

Reviewed by Antti Koivisto.

Source/WebKit2:

Make responses with 404 HTTP Status Code cacheable by default, as
per RFC 7231:
http://tools.ietf.org/html/rfc7231#section-6.5.4

Test: http/tests/cache/disk-cache/disk-cache-404-status-code.html

  • NetworkProcess/cache/NetworkCache.cpp:

(WebKit::NetworkCache::canStore):

LayoutTests:

Add test to make sure that responses with 404 HTTP Status Code are
cacheable by default.

  • http/tests/cache/disk-cache/disk-cache-404-status-code-expected.txt: Added.
  • http/tests/cache/disk-cache/disk-cache-404-status-code.html: Added.
  • http/tests/cache/disk-cache/resources/generate-response.cgi:
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r181901 r181904  
     12015-03-24  Chris Dumez  <cdumez@apple.com>
     2
     3        [WK2] Responses with 404 HTTP Status Code should be cacheable by default
     4        https://bugs.webkit.org/show_bug.cgi?id=143014
     5        <rdar://problem/20280310>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Add test to make sure that responses with 404 HTTP Status Code are
     10        cacheable by default.
     11
     12        * http/tests/cache/disk-cache/disk-cache-404-status-code-expected.txt: Added.
     13        * http/tests/cache/disk-cache/disk-cache-404-status-code.html: Added.
     14        * http/tests/cache/disk-cache/resources/generate-response.cgi:
     15
    1162015-03-24  Joseph Pecoraro  <pecoraro@apple.com>
    217
  • trunk/LayoutTests/http/tests/cache/disk-cache/resources/generate-response.cgi

    r181894 r181904  
    77@names = $query->param;
    88
     9my $hasStatusCode = 0;
    910if ($query->http && $query->http("If-None-Match") eq "match") {
    1011    print "Status: 304\n";
     12    $hasStatusCode = 1;
    1113}
    1214
    1315foreach (@names) {
    1416    next if ($_ eq "uniqueId");
     17    next if ($_ eq "Status" and $hasStatusCode);
    1518    print $_ . ": " . $query->param($_) . "\n";
    1619}
  • trunk/Source/WebKit2/ChangeLog

    r181902 r181904  
     12015-03-24  Chris Dumez  <cdumez@apple.com>
     2
     3        [WK2] Responses with 404 HTTP Status Code should be cacheable by default
     4        https://bugs.webkit.org/show_bug.cgi?id=143014
     5        <rdar://problem/20280310>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Make responses with 404 HTTP Status Code cacheable by default, as
     10        per RFC 7231:
     11        http://tools.ietf.org/html/rfc7231#section-6.5.4
     12
     13        Test: http/tests/cache/disk-cache/disk-cache-404-status-code.html
     14
     15        * NetworkProcess/cache/NetworkCache.cpp:
     16        (WebKit::NetworkCache::canStore):
     17
    1182015-03-24  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp

    r181902 r181904  
    326326    case 302: // Found
    327327    case 307: // Temporary Redirect
     328    case 404: // Not Found
    328329    case 410: // Gone
    329330        if (response.cacheControlContainsNoStore()) {
Note: See TracChangeset for help on using the changeset viewer.