-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Stale While Revalidate Handling #853
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
da68bc4
to
788b7bc
Compare
Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts loaded trigger a stale while revalidate cache hit and resource timing entries are correct. The PR for the spec changes is here: whatwg/fetch#853 BUG=348877 Change-Id: Ib07b98d0d2595b6b99857161f830343bf7516518
Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts loaded trigger a stale while revalidate cache hit and resource timing entries are correct. The PR for the spec changes is here: whatwg/fetch#853 BUG=348877 Change-Id: Ib07b98d0d2595b6b99857161f830343bf7516518 Reviewed-on: https://chromium-review.googlesource.com/c/1383297 Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/master@{#625228}
Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts loaded trigger a stale while revalidate cache hit and resource timing entries are correct. The PR for the spec changes is here: whatwg/fetch#853 BUG=348877 Change-Id: Ib07b98d0d2595b6b99857161f830343bf7516518 Reviewed-on: https://chromium-review.googlesource.com/c/1383297 Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/master@{#625228}
This reverts commit 05cdb4d. Reason for revert: Findit (https://goo.gl/kROfz5) identified CL at revision 625228 as the culprit for flakes in the build cycles as shown on: https://findit-for-me.appspot.com/waterfall/flake/flake-culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyQwsSDEZsYWtlQ3VscHJpdCIxY2hyb21pdW0vMDVjZGI0ZDFkOWNkYWEyZGYzZDkxY2Q5ZGMxNTBlZGE5MDNmZTM1Ygw Sample Failed Build: https://ci.chromium.org/buildbot/chromium.linux/Linux%20Tests%20%28dbg%29%281%29/77482 Sample Failed Step: webkit_layout_tests Sample Flaky Test: virtual/outofblink-cors-ns/external/wpt/fetch/stale-while-revalidate/stale-script.tentative.html Original change's description: > Add tentative WPT tests for stale while revalidate handling. > > Add test to ensure that handling the fetch doesn't trigger stale > while revalidate loading. > > Add test to ensure that scripts loaded trigger a stale while revalidate > cache hit and resource timing entries are correct. > > The PR for the spec changes is here: > whatwg/fetch#853 > > BUG=348877 > > Change-Id: Ib07b98d0d2595b6b99857161f830343bf7516518 > Reviewed-on: https://chromium-review.googlesource.com/c/1383297 > Commit-Queue: Dave Tapuska <dtapuska@chromium.org> > Reviewed-by: Ben Kelly <wanderview@chromium.org> > Cr-Commit-Position: refs/heads/master@{#625228} No-Presubmit: true No-Tree-Checks: true No-Try: true BUG=348877 Change-Id: Ie11ef55a64fcf3e39781666b65a47bbd157f04a2 Reviewed-on: https://chromium-review.googlesource.com/c/1432937 Cr-Commit-Position: refs/heads/master@{#625497}
Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43
Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43
Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43
Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43
Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43 Reviewed-on: https://chromium-review.googlesource.com/c/1434776 Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/master@{#626264}
Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43 Reviewed-on: https://chromium-review.googlesource.com/c/1434776 Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/master@{#626264}
Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43 Reviewed-on: https://chromium-review.googlesource.com/c/1434776 Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/master@{#626264}
This pull request now has tests that have been merged, I think the label can be removed. |
@dtapuska so as far as I can tell the naming comment is still outstanding as well as the new ability to bypass service workers when it comes to network requests. Also, is this parallel request fully defined? What if there's now a 401? Or a redirect (not followed per current rules)? |
We don't do anything different for 401s or redirects. It is exactly the same as another sub-resource; standard processing occurs. This is the benefit of having the revalidation associated with the context that initiated the resource request. The text indicates "in parallel perform" is that the naming? I indicated "Done" on the comment above. Is that the naming you are referring to? Did Kinuko's response not suffice? Top level requests are sent to the service worker if associated. Can you explain why you think the revalidation should go back to the service worker? Fetches created from the service worker have a "" destination. |
@dtapuska if standard processing occurs, the current PR is wrong, right? It invokes an algorithm that doesn't handle redirects. The naming comment is about "async" in the new enum value. Fetching is already asynchronous for all intents and purposes so this name is rather confusing. As for the service worker, we don't have many fetches that can bypass it, so the problem would be that now there is a way and the service worker can do nothing about it. That breaks a design decision around service workers. |
@annevk Sorry which enum value are you referring to? Only async I see in the pull request was in the title. I've since removed that. So you are saying you want the algorithm to do in parallel the "HTTP redirect fetch" or a "HTTP fetch with service worker mode set to none" instead of going into the network or cache fetch directly. That seems to make sense. |
I'm not sure, it's still not clear to me what the processing model is, and I'd like someone other than me to judge it's suddenly okay to bypass service workers when making network requests. That seems like a new primitive and rather isolated at that. |
The PR has been merged into the fetch spec. whatwg/fetch#853 BUG=348877 Change-Id: I5e06ebee3b968e569453df51a441338fb93df72a
PR for removing tentative and moving into resources is here: |
Thanks @dtapuska for seeing this through. If you have ideas for how we could make this more streamlined for you in the future those would be welcome. Perhaps synchronous communication at some point could have helped to set mutual expectations better? |
The PR has been merged into the fetch spec. whatwg/fetch#853 BUG=348877 Change-Id: I5e06ebee3b968e569453df51a441338fb93df72a
The PR has been merged into the fetch spec. whatwg/fetch#853 BUG=348877 Change-Id: I5e06ebee3b968e569453df51a441338fb93df72a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566154 Reviewed-by: Mustaq Ahmed <mustaq@chromium.org> Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Cr-Commit-Position: refs/heads/master@{#656466}
The PR has been merged into the fetch spec. whatwg/fetch#853 BUG=348877 Change-Id: I5e06ebee3b968e569453df51a441338fb93df72a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566154 Reviewed-by: Mustaq Ahmed <mustaq@chromium.org> Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Cr-Commit-Position: refs/heads/master@{#656466}
…-revalidate., a=testonly Automatic update from web-platform-tests Remove tentative suffix from stale-while-revalidate. The PR has been merged into the fetch spec. whatwg/fetch#853 BUG=348877 Change-Id: I5e06ebee3b968e569453df51a441338fb93df72a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566154 Reviewed-by: Mustaq Ahmed <mustaq@chromium.org> Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Cr-Commit-Position: refs/heads/master@{#656466} -- wpt-commits: 2905669d14b7a004c9a2f919a38a56f701c095c9 wpt-pr: 16337 --HG-- rename : testing/web-platform/tests/fetch/stale-while-revalidate/stale-css.py => testing/web-platform/tests/fetch/stale-while-revalidate/resources/stale-css.py rename : testing/web-platform/tests/fetch/stale-while-revalidate/stale-script.py => testing/web-platform/tests/fetch/stale-while-revalidate/resources/stale-script.py
…-revalidate., a=testonly Automatic update from web-platform-tests Remove tentative suffix from stale-while-revalidate. The PR has been merged into the fetch spec. whatwg/fetch#853 BUG=348877 Change-Id: I5e06ebee3b968e569453df51a441338fb93df72a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566154 Reviewed-by: Mustaq Ahmed <mustaq@chromium.org> Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Cr-Commit-Position: refs/heads/master@{#656466} -- wpt-commits: 2905669d14b7a004c9a2f919a38a56f701c095c9 wpt-pr: 16337
The PR has been merged into the fetch spec. whatwg/fetch#853 BUG=348877 Change-Id: I5e06ebee3b968e569453df51a441338fb93df72a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566154 Reviewed-by: Mustaq Ahmed <mustaq@chromium.org> Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Cr-Commit-Position: refs/heads/master@{#656466}
… while revalidate handling., a=testonly Automatic update from web-platform-tests Reland add tentative WPT tests for stale while revalidate handling. Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43 Reviewed-on: https://chromium-review.googlesource.com/c/1434776 Commit-Queue: Dave Tapuska <dtapuskachromium.org> Reviewed-by: Ben Kelly <wanderviewchromium.org> Cr-Commit-Position: refs/heads/master{#626264} -- wpt-commits: f8a34bc8fa3a9451717c974108d677e319243ded wpt-pr: 15047 UltraBlame original commit: 53cc2cd5c20c298cc1d7b855d0053fe58856bc10
… while revalidate handling., a=testonly Automatic update from web-platform-tests Reland add tentative WPT tests for stale while revalidate handling. Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43 Reviewed-on: https://chromium-review.googlesource.com/c/1434776 Commit-Queue: Dave Tapuska <dtapuskachromium.org> Reviewed-by: Ben Kelly <wanderviewchromium.org> Cr-Commit-Position: refs/heads/master{#626264} -- wpt-commits: f8a34bc8fa3a9451717c974108d677e319243ded wpt-pr: 15047 UltraBlame original commit: e65e05e0dfde39b8fa17ed514c9cdf72beaa0bb4
… while revalidate handling., a=testonly Automatic update from web-platform-tests Reland add tentative WPT tests for stale while revalidate handling. Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43 Reviewed-on: https://chromium-review.googlesource.com/c/1434776 Commit-Queue: Dave Tapuska <dtapuskachromium.org> Reviewed-by: Ben Kelly <wanderviewchromium.org> Cr-Commit-Position: refs/heads/master{#626264} -- wpt-commits: f8a34bc8fa3a9451717c974108d677e319243ded wpt-pr: 15047 UltraBlame original commit: 53cc2cd5c20c298cc1d7b855d0053fe58856bc10
… while revalidate handling., a=testonly Automatic update from web-platform-tests Reland add tentative WPT tests for stale while revalidate handling. Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43 Reviewed-on: https://chromium-review.googlesource.com/c/1434776 Commit-Queue: Dave Tapuska <dtapuskachromium.org> Reviewed-by: Ben Kelly <wanderviewchromium.org> Cr-Commit-Position: refs/heads/master{#626264} -- wpt-commits: f8a34bc8fa3a9451717c974108d677e319243ded wpt-pr: 15047 UltraBlame original commit: e65e05e0dfde39b8fa17ed514c9cdf72beaa0bb4
… while revalidate handling., a=testonly Automatic update from web-platform-tests Reland add tentative WPT tests for stale while revalidate handling. Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43 Reviewed-on: https://chromium-review.googlesource.com/c/1434776 Commit-Queue: Dave Tapuska <dtapuskachromium.org> Reviewed-by: Ben Kelly <wanderviewchromium.org> Cr-Commit-Position: refs/heads/master{#626264} -- wpt-commits: f8a34bc8fa3a9451717c974108d677e319243ded wpt-pr: 15047 UltraBlame original commit: 53cc2cd5c20c298cc1d7b855d0053fe58856bc10
… while revalidate handling., a=testonly Automatic update from web-platform-tests Reland add tentative WPT tests for stale while revalidate handling. Add test to ensure that handling the fetch doesn't trigger stale while revalidate loading. Add test to ensure that scripts and css loaded trigger a stale while revalidate cache hit. The PR for the spec changes is here: whatwg/fetch#853 This reland removes the resource timing and moves to css (instead of images) which were both unreliable. BUG=348877 Change-Id: Ibabd8d3fd0295bedc8259594fc926da6ab5cfc43 Reviewed-on: https://chromium-review.googlesource.com/c/1434776 Commit-Queue: Dave Tapuska <dtapuskachromium.org> Reviewed-by: Ben Kelly <wanderviewchromium.org> Cr-Commit-Position: refs/heads/master{#626264} -- wpt-commits: f8a34bc8fa3a9451717c974108d677e319243ded wpt-pr: 15047 UltraBlame original commit: e65e05e0dfde39b8fa17ed514c9cdf72beaa0bb4
…-revalidate., a=testonly Automatic update from web-platform-tests Remove tentative suffix from stale-while-revalidate. The PR has been merged into the fetch spec. whatwg/fetch#853 BUG=348877 Change-Id: I5e06ebee3b968e569453df51a441338fb93df72a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566154 Reviewed-by: Mustaq Ahmed <mustaqchromium.org> Commit-Queue: Dave Tapuska <dtapuskachromium.org> Cr-Commit-Position: refs/heads/master{#656466} -- wpt-commits: 2905669d14b7a004c9a2f919a38a56f701c095c9 wpt-pr: 16337 UltraBlame original commit: 33c537619b8ff8ff6c4de79246c5ffc6fddcc766
…-revalidate., a=testonly Automatic update from web-platform-tests Remove tentative suffix from stale-while-revalidate. The PR has been merged into the fetch spec. whatwg/fetch#853 BUG=348877 Change-Id: I5e06ebee3b968e569453df51a441338fb93df72a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566154 Reviewed-by: Mustaq Ahmed <mustaqchromium.org> Commit-Queue: Dave Tapuska <dtapuskachromium.org> Cr-Commit-Position: refs/heads/master{#656466} -- wpt-commits: 2905669d14b7a004c9a2f919a38a56f701c095c9 wpt-pr: 16337 UltraBlame original commit: 33c537619b8ff8ff6c4de79246c5ffc6fddcc766
…-revalidate., a=testonly Automatic update from web-platform-tests Remove tentative suffix from stale-while-revalidate. The PR has been merged into the fetch spec. whatwg/fetch#853 BUG=348877 Change-Id: I5e06ebee3b968e569453df51a441338fb93df72a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566154 Reviewed-by: Mustaq Ahmed <mustaqchromium.org> Commit-Queue: Dave Tapuska <dtapuskachromium.org> Cr-Commit-Position: refs/heads/master{#656466} -- wpt-commits: 2905669d14b7a004c9a2f919a38a56f701c095c9 wpt-pr: 16337 UltraBlame original commit: 33c537619b8ff8ff6c4de79246c5ffc6fddcc766
Hi. Are there any plans to add such an event so that we can handler to it? addEventListener('cache-stale-updated', event => myReRenderContent(event.response)); |
@uasan no plans, but if you want this to be considered properly please file a new issue, ideally after reading https://whatwg.org/faq#adding-new-features. Thanks! |
Define a new cache mode "async-stale-revalidated" to indicate that the
fetch stack should return a stale response if it can and aysnchronously
revalidate the response.
Fixes #852
Preview | Diff