[WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Mar 2015 17:35:39 +0000 (17:35 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Mar 2015 17:35:39 +0000 (17:35 +0000)
commit7203748ac528f3710c53e24e5cab18c2e278753d
treee6cc7a962656718ac824024bba2fe8d15a346762
parent366eb452d31732a7b21788ca20e677263965710a
[WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
https://bugs.webkit.org/show_bug.cgi?id=143159
<rdar://problem/20333296>

Reviewed by Antti Koivisto.

Source/WebCore:

Add support for "Cache-Control: max-stale" request header:
https://tools.ietf.org/html/rfc7234#section-5.2.1.2

Test: http/tests/cache/disk-cache/disk-cache-request-max-stale.html

* platform/network/CacheValidation.cpp:
(WebCore::parseCacheControlDirectives):
* platform/network/CacheValidation.h:

Source/WebKit2:

Add support for "Cache-Control: max-stale" request header:
https://tools.ietf.org/html/rfc7234#section-5.2.1.2

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::responseHasExpired):
(WebKit::NetworkCache::requestRequiresRevalidation):
(WebKit::NetworkCache::canUse):

LayoutTests:

Add layout test to cover support for "Cache-Control: max-stale" request
header.

* http/tests/cache/disk-cache/disk-cache-request-max-stale-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-request-max-stale.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/cache/disk-cache/disk-cache-request-max-stale-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cache/disk-cache/disk-cache-request-max-stale.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/network/CacheValidation.cpp
Source/WebCore/platform/network/CacheValidation.h
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp