Summary: | Duplicate requests due to speculative parsing with active service worker | ||
---|---|---|---|
Product: | WebKit | Reporter: | marian.schaub |
Component: | Service Workers | Assignee: | youenn fablet <youennf> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | achristensen, cdumez, webkit-bug-importer, youennf |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari Technology Preview | ||
Hardware: | Mac (Apple Silicon) | ||
OS: | macOS 13 | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=194589 |
Description
marian.schaub
2023-01-11 06:40:05 PST
I can only reproduce this in case of Hard Reload and/or in case cache is disabled in web inspector. @Marian, is it correct? Hey Youenn, sorry for the delayed response. Yes, I tested a bit more with other resources and Hard Reload/Disable Cache does seem to be required for reproducing this behavior. An update from our side: We did a bit more testing and were after all able to reproduce the described behavior without the use of the mentioned settings. For our initial test setup we also noticed an additional case besides Hard Reload and Disable Cache: We can also reproduce the problem on the first load after installing the service worker. This also happens without the use of Disable Cache. For all subsequent reloads the behavior does not occur as you have pointed out. We additionally set up another test page which does in general behave similar to our first test but instead of using a cacheable blocking script (main.js) we now use a script which the browser cannot cache (otherScript). Now the behavior is reproducible even without the additional settings and also on subsequent reloads: 1. Open https://sw-lifecycle-test.app.baqend.com/speculativeParser/index2.html?sw=1 2. Open web inspector without checking "Disable Cache" 3. Reload page Now we can once again see two requests for each of the resources that are actually fetched by the service worker (test1.jpeg and slowScript), one initiated by the line of the un-cacheable script (otherScript, line 26) and one request initiated by the respective tags (line 27 and 29) (In reply to youenn fablet from comment #2) > I can only reproduce this in case of Hard Reload and/or in case cache is > disabled in web inspector. > @Marian, is it correct? Hey Youenn, have you had the chance to revisit the reproduction steps in our latest comment where the "Disable Cache" flag is no longer requiered? I just tested again and it seems the issue is still present in the latest Safari and Technology Preview Pull request: https://github.com/WebKit/WebKit/pull/21729 Committed 272024@main (c68a38f2d6eb): <https://commits.webkit.org/272024@main> Reviewed commits have been landed. Closing PR #21729 and removing active labels. |