[WK2] The WebKit network cache does not cache responses with "Content-Disposition...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Mar 2015 16:44:19 +0000 (16:44 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Mar 2015 16:44:19 +0000 (16:44 +0000)
commit6729992f2cabf63d24f2a1a6d3c9a5ae1d240751
tree96e7a7190f057721f5b6f73bbd0f98313df631f5
parent8e734cffebbbb5576fb49ccf4ca53d7f33ae0cb1
[WK2] The WebKit network cache does not cache responses with "Content-Disposition: attachment" header
https://bugs.webkit.org/show_bug.cgi?id=142989
<rdar://problem/20265992>

Reviewed by Antti Koivisto.

Source/WebKit2:

Update our WebKit network cache policy to cache responses with
"Content-Disposition: attachment" header. There is no reason we cannot
cache these and our memory cache already does.

This was causing a decent amount of cache misses in the wild. I have
noticed for example that when loading disney.com, we fail to cache the
following resources because of this policy:
http://pagead2.googlesyndication.com/pagead/osd.js
http://pagead2.googlesyndication.com/pagead/show_companion_ad.js

Those resources have Cache-Control headers that indicate they are meant
to be cacheable.

Test: http/tests/cache/disk-cache-validation-attachment.html

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::canStore):

LayoutTests:

Add layout test to check that resources whose response has the
"Content-Disposition: attachment" header are cacheable.

Also move all disk cache layout tests to a disk-cache sub-folder to
facilitate skipping on platforms that don't have the WebKit network
disk cache.

* http/tests/cache/disk-cache/disk-cache-disable-expected.txt: Renamed from LayoutTests/http/tests/cache/disk-cache-disable-expected.txt.
* http/tests/cache/disk-cache/disk-cache-disable.html: Renamed from LayoutTests/http/tests/cache/disk-cache-disable.html.
* http/tests/cache/disk-cache/disk-cache-redirect-to-data-expected.txt: Renamed from LayoutTests/http/tests/cache/disk-cache-redirect-to-data-expected.txt.
* http/tests/cache/disk-cache/disk-cache-redirect-to-data.html: Renamed from LayoutTests/http/tests/cache/disk-cache-redirect-to-data.html.
* http/tests/cache/disk-cache/disk-cache-validation-attachment-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-validation-attachment.html: Added.
* http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy-expected.txt: Renamed from LayoutTests/http/tests/cache/disk-cache-validation-back-navigation-policy-expected.txt.
* http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy.html: Renamed from LayoutTests/http/tests/cache/disk-cache-validation-back-navigation-policy.html.
* http/tests/cache/disk-cache/disk-cache-validation-expected.txt: Renamed from LayoutTests/http/tests/cache/disk-cache-validation-expected.txt.
* http/tests/cache/disk-cache/disk-cache-validation.html: Renamed from LayoutTests/http/tests/cache/disk-cache-validation.html.
* http/tests/cache/disk-cache/disk-cache-vary-cookie-expected.txt: Renamed from LayoutTests/http/tests/cache/disk-cache-vary-cookie-expected.txt.
* http/tests/cache/disk-cache/disk-cache-vary-cookie.html: Renamed from LayoutTests/http/tests/cache/disk-cache-vary-cookie.html.
* http/tests/cache/disk-cache/resources/cache-test.js: Renamed from LayoutTests/http/tests/cache/resources/cache-test.js.
* http/tests/cache/disk-cache/resources/generate-response.cgi: Renamed from LayoutTests/http/tests/cache/resources/generate-response.cgi.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/cache/disk-cache/disk-cache-disable-expected.txt [moved from LayoutTests/http/tests/cache/disk-cache-disable-expected.txt with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/disk-cache-disable.html [moved from LayoutTests/http/tests/cache/disk-cache-disable.html with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/disk-cache-redirect-to-data-expected.txt [moved from LayoutTests/http/tests/cache/disk-cache-redirect-to-data-expected.txt with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/disk-cache-redirect-to-data.html [moved from LayoutTests/http/tests/cache/disk-cache-redirect-to-data.html with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-attachment-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-attachment.html [new file with mode: 0644]
LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy-expected.txt [moved from LayoutTests/http/tests/cache/disk-cache-validation-back-navigation-policy-expected.txt with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy.html [moved from LayoutTests/http/tests/cache/disk-cache-validation-back-navigation-policy.html with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-expected.txt [moved from LayoutTests/http/tests/cache/disk-cache-validation-expected.txt with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/disk-cache-validation.html [moved from LayoutTests/http/tests/cache/disk-cache-validation.html with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie-expected.txt [moved from LayoutTests/http/tests/cache/disk-cache-vary-cookie-expected.txt with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html [moved from LayoutTests/http/tests/cache/disk-cache-vary-cookie.html with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js [moved from LayoutTests/http/tests/cache/resources/cache-test.js with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/resources/generate-response.cgi [moved from LayoutTests/http/tests/cache/resources/generate-response.cgi with 100% similarity]
LayoutTests/http/tests/cache/disk-cache/resources/redirect-to-data.php [moved from LayoutTests/http/tests/cache/resources/redirect-to-data.php with 100% similarity]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp