Enable disk cache for range requests
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 May 2015 02:09:14 +0000 (02:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 May 2015 02:09:14 +0000 (02:09 +0000)
commite00065e4d22e911a14a457052fda949d169d1e49
treed52949452bb06cf0fdb1071f2216a21e8c175a18
parent526317ad526d8f6c7c30c23e06034401a81780b1
Enable disk cache for range requests
https://bugs.webkit.org/show_bug.cgi?id=144682

Patch by Marcos Chavarría Teijeiro <mchavarria@igalia.com> on 2015-05-20
Reviewed by Antti Koivisto.

Source/WebKit2:

Add Range header value to the network cache key constructor so we take
into account this value. The 206 response code is also marked to be cached.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeCacheKey):
(WebKit::NetworkCache::isStatusCodeCacheableByDefault):
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::Key::Key):
(WebKit::NetworkCache::Key::operator=):
(WebKit::NetworkCache::Key::computeHash):
(WebKit::NetworkCache::Key::operator==):
(WebKit::NetworkCache::Key::encode):
(WebKit::NetworkCache::Key::decode):
(WebKit::NetworkCache::Key::stringToHash): Deleted.
* NetworkProcess/cache/NetworkCacheKey.h:

LayoutTests:

* http/tests/cache/disk-cache/disk-cache-range-expected.txt: Added. Add Test.
* http/tests/cache/disk-cache/disk-cache-range.html: Added.
* http/tests/cache/disk-cache/resources/generate-response.cgi: Modify script to return 206 and 416 response codes if Range header is present.
* platform/gtk/TestExpectations: Remove failing test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/cache/disk-cache/disk-cache-range-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cache/disk-cache/disk-cache-range.html [new file with mode: 0644]
LayoutTests/http/tests/cache/disk-cache/resources/generate-response.cgi
LayoutTests/platform/gtk/TestExpectations
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.h