Disable speculative loading if cache is not to be used for the load
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jul 2019 00:55:16 +0000 (00:55 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jul 2019 00:55:16 +0000 (00:55 +0000)
commit44886dd30e588587fbaab3036c4a0e2f0867abbe
treea4ff7544389043d47f897a30bcf2995cef8817c1
parentae89a14cf2ea10b7ce040b4abc5698fe1899aa50
Disable speculative loading if cache is not to be used for the load
https://bugs.webkit.org/show_bug.cgi?id=199644

Reviewed by Alex Christensen.

Source/WebKit:

When the page is reloaded, loads are instructed to not use the cache.
It is therefore unneeded to do speculative revalidation.
Allow speculative revalidation if the cache policy is either the default HTTP policy or
if policy is to refresh all cache data.
Covered by added test.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::cachePolicyValidForSpeculativeRevalidation):
(WebKit::NetworkCache::canRequestUseSpeculativeRevalidation):

LayoutTests:

* http/wpt/fetch/disable-speculative-for-reload-expected.txt: Added.
* http/wpt/fetch/disable-speculative-for-reload.html: Added.
* http/wpt/fetch/resources/iframe-with-image.py: Added.
(main):
* http/wpt/fetch/resources/image-load-count.py: Added.
(main):
* http/wpt/fetch/resources/image-load.py: Added.
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247806 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/wpt/fetch/disable-speculative-for-reload-expected.txt [new file with mode: 0644]
LayoutTests/http/wpt/fetch/disable-speculative-for-reload.html [new file with mode: 0644]
LayoutTests/http/wpt/fetch/resources/iframe-with-image.py [new file with mode: 0644]
LayoutTests/http/wpt/fetch/resources/image-load-count.py [new file with mode: 0644]
LayoutTests/http/wpt/fetch/resources/image-load.py [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cache/NetworkCache.cpp