<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [link preload] Double downloads of preloaded CSS"
   href="https://bugs.webkit.org/show_bug.cgi?id=169274#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [link preload] Double downloads of preloaded CSS"
   href="https://bugs.webkit.org/show_bug.cgi?id=169274">bug 169274</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=169274#c3">comment #3</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=303647&amp;action=diff" name="attach_303647" title="Patch">attachment 303647</a> <a href="attachment.cgi?id=303647&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=303647&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=303647&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebCore/loader/cache/CachedResourceLoader.cpp:929
&gt; &gt; +    if (textDecoder &amp;&amp; !textDecoder-&gt;hasEqualEncodingForCharset(cachedResourceRequest.charset())) {
&gt; &gt; +        if (!existingResource-&gt;isLinkPreload())
&gt; &gt; +            return Reload;
&gt; &gt; +        existingResource-&gt;setEncoding(cachedResourceRequest.charset());
&gt; &gt; +    }
&gt; 
&gt; What happens if there are multiple requests for the same link-preloaded
&gt; resource with different charsets?
&gt; 
&gt; &lt;link rel=&quot;preload&quot; href=&quot;foo.js&quot; as=&quot;script&quot;&gt;
&gt; ...
&gt; &lt;script src=&quot;foo.js&quot; charset=utf-8&gt;&lt;/script&gt;
&gt; &lt;script src=&quot;foo.js&quot; charset=latin1&gt;&lt;/script&gt;</span >

I agree that in that case, we'll enforce two different encodings on the same resource, and that can result in us sending the wrongly decoded text to the second resource.

Maybe we also need to discard any cached decoded text in the related CachedResources?</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>