<story><title>Why Prefetch Is Broken</title><url>https://www.jefftk.com/p/why-prefetch-is-broken</url></story><parent_chain><item><author>matsemann</author><text>I don&amp;#x27;t really understand the issue? If I want to prefetch an image, I&amp;#x27;m on the same origin the whole time and this cache segregation doesn&amp;#x27;t matter.</text></item></parent_chain><comment><author>cxr</author><text>Indeed.  As the author puts it &amp;quot;sometimes you know something is very likely to be needed&amp;quot;.  Let&amp;#x27;s have a look:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    &amp;lt;link rel=prefetch href=url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
What&amp;#x27;s going on here, for the test case given?  It&amp;#x27;s introducing tight coupling (or it already exists, and you&amp;#x27;re trying to capture a description of it to serve to the browser) to an external resource.  It&amp;#x27;s not that prefetch is broken, it&amp;#x27;s that to desire to be able to gesture at the existence of a resource outside your organization&amp;#x27;s control, while insisting that it&amp;#x27;s so important as to be timing-critical, is like trying to have your cake and eat it, too.&lt;p&gt;As mentioned in similar comments, the observed behavior for this particular test case is potentially a problem if you are building Modern Web Apps by following the received wisdom of how you&amp;#x27;re supposed to do that.  There are lots of unstated assumptions in the article in this vein.  One such assumption is that you&amp;#x27;re going to do things that way.  Another assumption is that the arguments for doing things that way and the plight of the tech professionals doing the doing are universally recognized and accepted.&lt;p&gt;From the Web-theoretic perspective—that is, following the original use cases that the Web was created to address—if that resource is so important to your organization, then you can mint your own identifier for it under your own authority.&lt;p&gt;Ultimately, I don&amp;#x27;t have a lot of sympathy for the plight described in the article.  It&amp;#x27;s fair to say that the instances where this sort of thing shows up involve abusing the fundamental mechanism of the Web to do things that are, although widely accepted by contemporaries as standard practice, totally counter to its spirit.</text></comment>
<story><title>Why Prefetch Is Broken</title><url>https://www.jefftk.com/p/why-prefetch-is-broken</url></story><parent_chain><item><author>matsemann</author><text>I don&amp;#x27;t really understand the issue? If I want to prefetch an image, I&amp;#x27;m on the same origin the whole time and this cache segregation doesn&amp;#x27;t matter.</text></item></parent_chain><comment><author>jefftk</author><text>Yes, sorry, an image is a bad example. The main issue is with HTML documents. You might open one at the top level, by clicking on it and navigating to it, or you might open one as a child of the current page, by putting it in an iframe. Since they can be opened in both contexts, prefetch doesn&amp;#x27;t know what to do.</text></comment>