<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#c8">Comment # 8</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#c7">comment #7</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=169274#c5">comment #5</a>)
&gt; &gt; Maybe you can track if the preload has been already been used and if so
&gt; &gt; require full charset match (or reload)? Or maybe just reset the link-preload
&gt; &gt; bit on the first match?
&gt; 
&gt; Yeah, took that route and turned off the flag when reusing a charset
&gt; mismatch.
&gt; 
&gt; &gt; 
&gt; &gt; A better, more complicated solution would be to support multiple charsets on
&gt; &gt; CachedResource level. Clients would provide charset as a parameter on all
&gt; &gt; accesses to decoded strings.</span >

I'm thinking about taking the second route, as it seems cleaner (thinking about it some more, turning off the flag in the charset case seems arbitrary).

Looking at the various CachedResource types it seems like:
* CachedCSSStyleSheet never reuses decoded text.
* Scripts do reuse previously decoded text.
* SVG never reuses decoded text.
* XSLT do reuse previously decoded text.

So, I think that simply getting rid of the internal representation of the decoded text whenever there's an encoding change can be enough to maintain charset correctness.

Let me know what you think.</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>