Bug 226382

Summary: Prefetching cross-origin subresources for the current page gives double fetch
Product: WebKit Reporter: Jeff Kaufman <jeff.t.kaufman>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: achristensen, beidson, koivisto, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Mac (Intel)   
OS: macOS 11   
Bug Depends on: 194539    
Bug Blocks:    

Jeff Kaufman
Reported 2021-05-28 11:29:02 PDT
When a page makes a cross-origin prefetch it's not used on that page. To reproduce: 1. Turn on Develop > Experimental Features > LinkPrefetch (tested in Version 14.1) 2. Visit https://www.jefftk.com/test/prefetch/prefetch-nested 3. See that bg.css, log.js, and hello-world are immediately fetched 4. After waiting five seconds, see that they are fetched a second time (confirmed with server logs) I tried adding "as=" attributes, without effect: https://www.jefftk.com/test/prefetch/prefetch-nested-as It looks to me like the document is used for prefetching if I navigate to it instead of putting it in an iframe (https://www.jefftk.com/test/prefetch/prefetch-navigate). This one does make some sense: if you prefetch a document you could plausibly either want to navigate the whole page to it, or navigate an iframe. Chrome handles this the same way as Safari, while Firefox does the opposite; I've filed https://github.com/whatwg/html/issues/6723
Attachments
Radar WebKit Bug Importer
Comment 1 2021-06-04 11:29:19 PDT
Note You need to log in before you can comment on or make changes to this bug.