<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Avoid evicting link preload resources when parsing is done."
   href="https://bugs.webkit.org/show_bug.cgi?id=167415#c26">Comment # 26</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Avoid evicting link preload resources when parsing is done."
   href="https://bugs.webkit.org/show_bug.cgi?id=167415">bug 167415</a>
              from <span class="vcard"><a class="email" href="mailto:yoav&#64;yoav.ws" title="Yoav Weiss &lt;yoav&#64;yoav.ws&gt;"> <span class="fn">Yoav Weiss</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=167415#c25">comment #25</a>)
<span class="quote">&gt; The handling of preloads is a bit complex and it would be good if we could
&gt; simplify it.
&gt; Can we try to align preloads with other loaded resources?
&gt; Here are some thoughts below.
&gt; 
&gt; Maybe m_preloads could store CachedResourceHandle.</span >

That might be possible IIUC. Seems orthogonal to this particular issue though.

<span class="quote">&gt; 
&gt; AFAIUI, body link preloads have a loader so they will not be cancelled when
&gt; the parsing is done. Maybe we should have a way for header link preloads to
&gt; behave the same.
&gt; 
&gt; When we would clean m_preloads at the end of parsing, only the speculative
&gt; preloads without any other attached loader would actually be cancelled.</span >

So, the end goal of this patch is to enable another patch:
* Add warnings for unused preloads - <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add a warning for unused link preloads."
   href="show_bug.cgi?id=165670">https://bugs.webkit.org/show_bug.cgi?id=165670</a>

That foal requires us to distinguish unused link preloads for used ones. So even if we find a way to declare header preloads as referenced, we'd need another (very similar) mechanism to then say &quot;this is a referenced link preload&quot;.

In Blink I used the similar `m_preloadResult != PreloadNotReferenced` mechanism to do that, and excluded link preloads from setting the result to referenced.

I'm happy to discuss alternative designs, but thought said end goal is relevant for the discussion.

One other relevant point: I'm planning to add preloadScanner support for linkPreload, after which we will have speculative link preloads as well.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>