Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Issue 1987973002: Reload cache control: remove redundant header insertion from Blink

Created:
4 years, 7 months ago by Takashi Toyoshima
Modified:
4 years, 6 months ago
Reviewers:
hiroshige, Nate Chapin
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, cbentzel+watch_chromium.org, Yoav Weiss, Peter Beverloo, jam, tyoshino+watch_chromium.org, blink-reviews, darin-cc_chromium.org, gavinp+loader_chromium.org, loading-reviews_chromium.org, loading-reviews+fetch_chromium.org, mkwst+moarreviews-shell_chromium.org, Nate Chapin, jochen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reload cache control: remove redundant header insertion from Blink Now Blink inserts "Cache-Control: max-age=0", "If-Modified-Since", and "If-None-Match" headers for resource revalidation. But we also use WebCachePolicy::ValidatingCacheData in such cases so that //net handles such headers. So we can safely remove this insertion from Blink, and it would help to avoid unexpected cache control flag mismatches. Beforehand, I added some content_browsertests to verify the header for several reloads. https://codereview.chromium.org/1905873002/ https://codereview.chromium.org/1993603003/ And this change actually removes the insertion code from Blink. This is historical code that exists before Chrome was born, there WebKit does not assume our net like backend for networking. This is one origin though it has moved around in tens of refactorings https://chromium.googlesource.com/chromium/src/+/21a8f9925eacbc8016e44bb1bd81250145552ba0/third_party/WebKit/WebCore/loader/FrameLoader.cpp BUG=602900 TEST=content_browsertests --gtest_filter='Reload*.*'

Patch Set 1 #

Patch Set 2 : rebase to https://codereview.chromium.org/1905873002/ #

Patch Set 3 : rebase #

Patch Set 4 : remove other headers modification #

Patch Set 5 : Add another test for last-modified #

Patch Set 6 : Android build fix #

Patch Set 7 : rebase (modify newly added tests too) #

Patch Set 8 : cacheControlContainsNoCache #

Total comments: 1

Patch Set 9 : (just rebase to see bots' results again) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -17 lines) Patch
M content/browser/loader/reload_cache_control_browsertest.cc View 1 2 3 4 5 6 7 chunks +77 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceRequest.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 13 (6 generated)
Takashi Toyoshima
Copy hiroshige's comments from https://codereview.chromium.org/1905873002/#msg23 ---- ResourceRequest's http headers are observable in Blink (while the ...
4 years, 7 months ago (2016-05-18 05:13:13 UTC) #4
Takashi Toyoshima
hiroshige: let me check if we can also remove other headers modification. I guess If_Modified_Since ...
4 years, 7 months ago (2016-05-18 09:41:25 UTC) #5
Takashi Toyoshima
Yes, we can remove them safely too. I remove them too and add some browser ...
4 years, 7 months ago (2016-05-18 10:33:47 UTC) #6
Takashi Toyoshima
Note: this isn't urgent, and I'll need to fix build errors on android.
4 years, 7 months ago (2016-05-19 05:32:35 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1987973002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1987973002/120001
4 years, 7 months ago (2016-05-19 08:10:55 UTC) #9
Takashi Toyoshima
I double-checked code that refer ResourceRequest's headers. Probably, I should modify ResourceRequest::cacheControlContainsNoCache() to consider cache ...
4 years, 7 months ago (2016-05-19 08:27:20 UTC) #12
hiroshige
4 years, 6 months ago (2016-05-31 11:44:46 UTC) #13
Some more questions:

1. Does //net adds if-modified-since headers etc. according to the corresponding
entry in the disk cache?
If so, does this CL remove if-modified-since headers if the corresponding entry
in the disk cache doesn't exist (e.g. already evicted) while MemoryCache
contains a Resource to revalidate?

2. Does //net adds if-modified-since headers etc. after a redirect is received?
For example, when [URL A] returns 308 (or another redirect status) to [URL B]
during revalidation:
Currently, IIUC ResourceFetcher adds if-modified-since header and the
if-modified-since header is added both the requests to [URL A] and [URL B].
After this CL, is the if-modified-since header added to the request to [URL B]?

https://codereview.chromium.org/1987973002/diff/140001/content/browser/loader...
File content/browser/loader/reload_cache_control_browsertest.cc (right):

https://codereview.chromium.org/1987973002/diff/140001/content/browser/loader...
content/browser/loader/reload_cache_control_browsertest.cc:164:
IN_PROC_BROWSER_TEST_F(ReloadCacheControlBrowserTest, BypassingReload) {
Memo: this test doesn't call ResourceFetcher::initializeRevalidation().

Powered by Google App Engine
This is Rietveld 408576698