New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 34 users
Status: Fixed
Owner:
Closed: Nov 14
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug


Sign in to add a comment
Support fetch() cache control options.
Project Member Reported by horo@chromium.org, Jan 29 2015 Back to list
request.cache was introduced in the Fetch API spec.
https://github.com/whatwg/fetch/commit/99377cd334e7e4e7737c2b2fd521c74a6cf7e01a

But Chrome doesn't support it yet.
There is a privacy concerns about this cache parameter.
https://github.com/slightlyoff/ServiceWorker/issues/585

When this concerns will be solved, we should support it.

 
Comment 1 by horo@chromium.org, Jan 29 2015
Blocking: chromium:451664
Blocking: chromium:455093
Labels: Cr-Blink-Fetch
Comment 4 by falken@chromium.org, Apr 16 2015
Labels: -Cr-Blink-ServiceWorker
Any update on this one? I'm going to remove SW now that Fetch is exposed on window.
No update, and it's OK to remove the label.

Comment 6 by horo@chromium.org, May 7 2015
 Issue 484485  has been merged into this issue.
Comment 7 by tkent@chromium.org, Aug 5 2015
Labels: -Cr-Blink-Fetch Cr-Blink-FetchAPI
Owner: kenjibaheux@chromium.org
Sorting out the privacy question.
Labels: Hotlist-Recharge
This issue likely requires triage.  The current issue owner maybe inactive (i.e. hasn't fixed an issue in the last 30 days).  Thanks for helping out!

-Anthony
Comment 10 by jeffy@google.com, Sep 24 2015
I wanted to point out that and increasingly common pattern I'm seeing "in the wild" is folks who use service workers to precache a list of resources as part of the oninstall handler, and then use a cache-first policy to serve responses in their onfetch handler.

The problems lie when a resource changes—let's say that the developer bumps a cache versioning string embedded in the service worker script, triggering another oninstall handler. It's very important that the HTTP requests used to repopulate the Cache Storage API cache go against the network and not the browser's HTTP cache at this point, because if it hits the browser's HTTP cache, that stale response will be reused in the subsequent cache-first onfetch handler, defeating the purpose of cache versioning.

Right now, one workaround is to append cache-busting URL parameters when requesting resources prior to using a cache-first onfetch handler, but that's a kludge. Much cleaner would be if `new Request('https://example.com/path/to/resource', {cache: 'reload'}))` worked as documented.

(Bonus points if, down the line, there were an easy way to get cache.addAll([urlString1, urlString2, ...]) to use {cache: 'reload'} for each Request it constructs, but that's a different issue outside the scope of this bug.)

You can see an example of what the current, kludgy best practice looks like at https://github.com/GoogleChrome/samples/blob/e4df12c8642381243b6c1710c41394d85b33d82f/service-worker/prefetch/service-worker.js#L36
Comment 11 by tkent@chromium.org, Nov 27 2015
Labels: -Cr-Blink-FetchAPI Cr-Blink-Network-FetchAPI
Comment 12 by horo@chromium.org, Jan 25 2016
Cc: gavinp@chromium.org
 Issue 451664  has been merged into this issue.
We might want to give this a higher priority. Although it's performance anti-pattern to bypass the cache in SW updates, it's being pointed to externally as a service worker failure https://twitter.com/AshleyGullen/status/702788084652494848 :(
FWIW I'm working on implementing this in Firefox right now.  If everything goes well, I should have patches up for review this week, so it will be likely that we ship this in Firefox 47 or 48 at the latest.
Owner: tyoshino@chromium.org
Status: Assigned
Given #10 #13 and #14 we should prioritize this higher. And also FetchEvent.request.cache. Related, FetchEvent.request.isReload is going away from the spec and we'll need that implemented to have an alternative.

Would the network API team be able to take this? Assign to tyoshino for triage.
Let's start implementation. only-if-cached would be restricted to same-origin only initially.

See https://github.com/whatwg/fetch/issues/159
This came up at the F2F in the context of https://github.com/slightlyoff/ServiceWorker/issues/873

Seems like developers wants this (the .cache in particular).
Can someone take ownership?
Blocking: 652994
Firefox implemented this: https://bugzilla.mozilla.org/show_bug.cgi?id=1120715

Can we bump priority so we can start deprecating FetchEvent.isReload?
Implementation note: watch out for  bug 627481 ,  bug 579866 ,  bug 648761  when implementing.
Project Member Comment 21 by bugdroid1@chromium.org, Oct 24 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6a97fb88d5ad4c437c60562d0083a87b898547a4

commit 6a97fb88d5ad4c437c60562d0083a87b898547a4
Author: shimazu <shimazu@chromium.org>
Date: Mon Oct 24 02:57:12 2016

Update expectations of imported/wpt/service-workers

As mentioned at  https://crbug.com/602693#c17  and https://crbug.com/657869,
'[ Skip ]' in TestExpectations cannot be overwritten by WPTTestExpectations.
This patch changes '[ Skip ]' to '[ Failure ]' by default in TestExpectations
in order to run the w3c tests on WPTServe bots.

BUG= 602693 , 453190 ,624278,617886,571722, 618616 
TEST=./third_party/WebKit/Tools/Scripts/run-webkit-tests -f -t Debug imported/wpt/service-workers
TEST=./third_party/WebKit/Tools/Scripts/run-webkit-tests --enable-wptserve -f -t Debug imported/wpt/service-workers

Review-Url: https://codereview.chromium.org/2441963002
Cr-Commit-Position: refs/heads/master@{#427010}

[modify] https://crrev.com/6a97fb88d5ad4c437c60562d0083a87b898547a4/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/6a97fb88d5ad4c437c60562d0083a87b898547a4/third_party/WebKit/LayoutTests/WPTServeExpectations

Cc: surma@chromium.org
Cc: kenjibaheux@chromium.org csharrison@chromium.org
 Issue 688427  has been merged into this issue.
Project Member Comment 24 by bugdroid1@chromium.org, Apr 12 2017
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8a82f1f36590e504b12f486df6351e78ca223097

commit 8a82f1f36590e504b12f486df6351e78ca223097
Author: yiyix <yiyix@chromium.org>
Date: Wed Apr 12 15:28:12 2017

Fetch API: Add Request#cache attribute

Behind the run time flag FetchRequestCache, a new attribute |cache|
is added into fetch request. Cache can be set to "default", "no-store",
"reload", "no-cache", "force-cache" or "only-if-cached". Please refer
to https://fetch.spec.whatwg.org/#requestsNote for exact definition.
Note that the implementation of cache options are not completed yet.

TEST=request-init-003.sub.html

BUG= 453190 

Review-Url: https://codereview.chromium.org/2811623002
Cr-Commit-Position: refs/heads/master@{#464032}

[delete] https://crrev.com/80e3eb904ef28e2491b831099597fc05347845ae/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-clone.sub-expected.txt
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-idl-expected.txt
[delete] https://crrev.com/80e3eb904ef28e2491b831099597fc05347845ae/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-init-003.sub-expected.txt
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-structure-expected.txt
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https-expected.txt
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/Source/modules/fetch/FetchRequestData.cpp
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/Source/modules/fetch/FetchRequestData.h
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/Source/modules/fetch/Request.cpp
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/Source/modules/fetch/Request.h
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/Source/modules/fetch/Request.idl
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/Source/modules/fetch/RequestInit.cpp
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/Source/modules/fetch/RequestInit.h
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/Source/platform/exported/WebServiceWorkerRequest.cpp
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/public/platform/WebURLRequest.h
[modify] https://crrev.com/8a82f1f36590e504b12f486df6351e78ca223097/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerRequest.h

Cc: -tyoshino@chromium.org
Labels: -Hotlist-Recharge
Owner: ----
Status: Available
Should we assign this to yiyix@ or it's supposed to be taken over by someone else in Tokyo?
Owner: yiyix@chromium.org
Status: Started
I think yiyix@ is still working on this, assigning for now.
yiyix any updates or would it be better to revert this to available to avoid creating confusion about the state of this FR?
After returning to my home office after chrome envoy, I took a break on this implementation. I resumed working on this this week. If this is urgent, feel free to assign to other people. I will report my status here. 
Owner: falken@chromium.org
Status: Assigned
 Issue 739191  has been merged into this issue.
Cc: leon....@intel.com
Blocking: 624278
Cc: -yhirano@chromium.org falken@chromium.org
Owner: yhirano@chromium.org
I'll make a try.
Project Member Comment 34 by bugdroid1@chromium.org, Oct 24
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/962c142c3a12f4b16ff4e586ed7b9ed1f8cedc76

commit 962c142c3a12f4b16ff4e586ed7b9ed1f8cedc76
Author: Yutaka Hirano <yhirano@chromium.org>
Date: Tue Oct 24 01:19:13 2017

Move WebURLRequest::FetchRequestCacheMode to mojom::FetchCacheMode

This is a preparation for merging the cache mode and WebCachePolicy.

Bug:  453190 
Change-Id: I47dea5b1e53163474ec333d09ba9b333a8229eba
Reviewed-on: https://chromium-review.googlesource.com/724941
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510981}
[modify] https://crrev.com/962c142c3a12f4b16ff4e586ed7b9ed1f8cedc76/third_party/WebKit/Source/modules/fetch/FetchRequestData.cpp
[modify] https://crrev.com/962c142c3a12f4b16ff4e586ed7b9ed1f8cedc76/third_party/WebKit/Source/modules/fetch/FetchRequestData.h
[modify] https://crrev.com/962c142c3a12f4b16ff4e586ed7b9ed1f8cedc76/third_party/WebKit/Source/modules/fetch/Request.cpp
[modify] https://crrev.com/962c142c3a12f4b16ff4e586ed7b9ed1f8cedc76/third_party/WebKit/Source/modules/fetch/RequestTest.cpp
[modify] https://crrev.com/962c142c3a12f4b16ff4e586ed7b9ed1f8cedc76/third_party/WebKit/Source/platform/exported/WebServiceWorkerRequest.cpp
[modify] https://crrev.com/962c142c3a12f4b16ff4e586ed7b9ed1f8cedc76/third_party/WebKit/public/platform/WebURLRequest.h
[modify] https://crrev.com/962c142c3a12f4b16ff4e586ed7b9ed1f8cedc76/third_party/WebKit/public/platform/modules/fetch/fetch_api_request.mojom
[modify] https://crrev.com/962c142c3a12f4b16ff4e586ed7b9ed1f8cedc76/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerRequest.h

Project Member Comment 35 by bugdroid1@chromium.org, Oct 24
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/458b9132f3d40790e848d3b7dbca6d4c67d4893f

commit 458b9132f3d40790e848d3b7dbca6d4c67d4893f
Author: Yutaka Hirano <yhirano@chromium.org>
Date: Tue Oct 24 15:17:21 2017

Unify WebCachePolicy and mojom::FetchCacheMode

This CL replaces WebCachePolicy by mojom::FetchCacheMode. Having two
similar enums is redundant / confusing, and transferring a mojo enum
is easier than transferring a usual enum over mojo.

 - kUseProtocolCachePolicy => kDefault
 - kValidatingCacheData => kValidateCache
 - kBypassingCache => kBypassCache
 - kReturnCacheDataElseLoad => kForceCache
 - kReturnCacheDataDontLoad => kOnlyIfCached
 - kReturnCacheDataIfValid => kUnspecifiedOnlyIfCachedStrictly
 - kBypassCacheLoadOnlyFromCache => kUnspecifiedForceCacheMiss


Bug:  453190 , 624278
Change-Id: I9b08cc47af1769960053cc540a7db5c6a1c3820b
Reviewed-on: https://chromium-review.googlesource.com/724563
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511149}
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/chrome/renderer/chrome_content_renderer_client.cc
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/chrome/renderer/net/net_error_helper.cc
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/public/common/BUILD.gn
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/public/renderer/associated_resource_fetcher.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/renderer/fetchers/associated_resource_fetcher_impl.cc
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/renderer/fetchers/associated_resource_fetcher_impl.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/renderer/fetchers/multi_resolution_image_resource_fetcher.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/renderer/image_downloader/image_downloader_base.cc
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/renderer/internal_document_state_data.cc
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/renderer/internal_document_state_data.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/renderer/loader/web_url_request_util.cc
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/content/renderer/render_frame_impl.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/dom/DocumentWriteIntervention.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/exported/WebViewTest.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/frame/FrameTestHelpers.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/frame/FrameTestHelpers.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/frame/VisualViewportTest.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/loader/FrameFetchContext.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/loader/FrameLoader.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/loader/HistoryItem.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/loader/HistoryItem.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/loader/ImageLoader.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/loader/resource/FontResourceTest.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/modules/fetch/Request.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/platform/loader/fetch/FetchContext.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/platform/loader/fetch/FetchContext.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/Source/platform/loader/fetch/ResourceRequestTest.cpp
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/public/BUILD.gn
[delete] https://crrev.com/8761b7bf600539b8e4ec8fb08d642a547af5815d/third_party/WebKit/public/platform/WebCachePolicy.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/public/platform/WebURLRequest.h
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/public/platform/modules/fetch/fetch_api_request.mojom
[modify] https://crrev.com/458b9132f3d40790e848d3b7dbca6d4c67d4893f/third_party/WebKit/public/web/WebLocalFrame.h

Project Member Comment 36 by bugdroid1@chromium.org, Oct 26
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8abcb4440c2292b997019c7b483564322b8c2654

commit 8abcb4440c2292b997019c7b483564322b8c2654
Author: Yutaka Hirano <yhirano@chromium.org>
Date: Thu Oct 26 18:28:46 2017

[Fetch API] Propagate cache mode to {Browser, ServiceWorker}

This CL propagetes "cache" property in Request to the browser and
service workers.

Bug:  453190 , 624278
Change-Id: I27275e2274e3dd5283bde80e090bec8a8a93b816
Reviewed-on: https://chromium-review.googlesource.com/737730
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Makoto Shimazu <shimazu@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511891}
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/content/browser/service_worker/service_worker_url_request_job.cc
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/content/common/service_worker/service_worker_fetch_request_struct_traits.cc
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/content/common/service_worker/service_worker_fetch_request_struct_traits.h
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/content/common/service_worker/service_worker_loader_helpers.cc
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/content/common/service_worker/service_worker_types.cc
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/content/common/service_worker/service_worker_types.h
[add] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/content/common/service_worker/service_worker_types_unittest.cc
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/content/renderer/service_worker/service_worker_context_client.cc
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/content/test/BUILD.gn
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-cache-force-cache-expected.txt
[delete] https://crrev.com/ca3ccab0a9efa18e9390dceeaf4a21d74396f8da/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-cache-no-cache-expected.txt
[delete] https://crrev.com/ca3ccab0a9efa18e9390dceeaf4a21d74396f8da/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-cache-only-if-cached-expected.txt
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https-expected.txt
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/third_party/WebKit/Source/modules/eventsource/EventSource.cpp
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/third_party/WebKit/Source/modules/fetch/Request.idl
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/third_party/WebKit/Source/platform/exported/WebServiceWorkerRequest.cpp
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/third_party/WebKit/Source/platform/mojo/FetchAPIRequestStructTraits.cpp
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/third_party/WebKit/Source/platform/mojo/FetchAPIRequestStructTraits.h
[modify] https://crrev.com/8abcb4440c2292b997019c7b483564322b8c2654/third_party/WebKit/public/platform/modules/fetch/fetch_api_request.mojom

Project Member Comment 37 by bugdroid1@chromium.org, Nov 9
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2a5ff162251e83562561831fca7aa6ae840b66d5

commit 2a5ff162251e83562561831fca7aa6ae840b66d5
Author: Yutaka Hirano <yhirano@chromium.org>
Date: Thu Nov 09 00:17:51 2017

[Fetch API] Throw if only-if-cached is set on a non same-origin Request

We should throw if 'only-if-cached' is specified as cache mode on a Request
whose mode is not 'same-origin'.

Bug:  453190 
Change-Id: I751ae6e5c470c5404a2a7bde43e5aedb4059edc2
Reviewed-on: https://chromium-review.googlesource.com/758376
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515027}
[modify] https://crrev.com/2a5ff162251e83562561831fca7aa6ae840b66d5/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/general-serviceworker.https-expected.txt
[modify] https://crrev.com/2a5ff162251e83562561831fca7aa6ae840b66d5/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/general-sharedworker-expected.txt
[modify] https://crrev.com/2a5ff162251e83562561831fca7aa6ae840b66d5/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/general.any-expected.txt
[modify] https://crrev.com/2a5ff162251e83562561831fca7aa6ae840b66d5/third_party/WebKit/LayoutTests/external/wpt/fetch/api/abort/general.any.worker-expected.txt
[modify] https://crrev.com/2a5ff162251e83562561831fca7aa6ae840b66d5/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-error-expected.txt
[modify] https://crrev.com/2a5ff162251e83562561831fca7aa6ae840b66d5/third_party/WebKit/Source/modules/fetch/Request.cpp

Project Member Comment 38 by bugdroid1@chromium.org, Nov 14
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/605fbdd9bd1096b1f411cabd0eee8db532616cd1

commit 605fbdd9bd1096b1f411cabd0eee8db532616cd1
Author: Yutaka Hirano <yhirano@chromium.org>
Date: Tue Nov 14 03:16:02 2017

[Fetch API] Ship Request.cache and RequestInit.cache

Intent-to-Ship thread: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/7aZGnBIlG5o

Bug:  453190 
Change-Id: I78b37684bd79ab64185c393ba778b6f9cf0b07fb
Reviewed-on: https://chromium-review.googlesource.com/763030
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516164}
[modify] https://crrev.com/605fbdd9bd1096b1f411cabd0eee8db532616cd1/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/605fbdd9bd1096b1f411cabd0eee8db532616cd1/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/605fbdd9bd1096b1f411cabd0eee8db532616cd1/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/605fbdd9bd1096b1f411cabd0eee8db532616cd1/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/605fbdd9bd1096b1f411cabd0eee8db532616cd1/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/605fbdd9bd1096b1f411cabd0eee8db532616cd1/third_party/WebKit/Source/platform/runtime_enabled_features.json5

Status: Fixed
Sign in to add a comment