<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>36399</bug_id>
          
          <creation_ts>2010-03-19 16:55:05 -0700</creation_ts>
          <short_desc>WorkerScriptLoader always (and unfortunately sometimes) inherits caching policy from the parent context.</short_desc>
          <delta_ts>2012-05-09 16:38:50 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dmitry Titov">dimich</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>atwilson</cc>
    
    <cc>fishd</cc>
    
    <cc>japhet</cc>
    
    <cc>levin</cc>
    
    <cc>tonyg</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>202105</commentid>
    <comment_count>0</comment_count>
    <who name="Dmitry Titov">dimich</who>
    <bug_when>2010-03-19 16:55:05 -0700</bug_when>
    <thetext>Probably since we switched from using CachedScript to ThreadableLoader in WorkerScriptLoader (http://trac.webkit.org/changeset/44726), the caching behavior changed in somewhat unfortunate way: when the page that creates more then 1 worker from the same script is &quot;reloaded&quot;, it re-validates all the resources via server roundtrip and if multiple workers are created from the same url, they get revalidated every time.

Here is the test created by Drew Wilson: http://www.corp.google.com/~atwilson/worker-latency.html

Click the link, it&apos;ll create several workers. Note the printed time. Hit refresh. It&apos;ll create several workers again, this time taking longer for each one, for roundtrip to the server.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>202175</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2010-03-19 22:56:48 -0700</bug_when>
    <thetext>See http://code.google.com/p/chromium/issues/detail?id=34092#c10.  I don&apos;t think this bug is unique to workers, and the fix probably can be made to SubresourceLoader in a manner that would work for all resource loads made after the page has loaded.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>202176</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-03-19 23:02:14 -0700</bug_when>
    <thetext>See also: bug 32423, bug 30862. We seem to be having two opposite bugs at once.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>203303</commentid>
    <comment_count>3</comment_count>
      <attachid>51470</attachid>
    <who name="Andrew Wilson">atwilson</who>
    <bug_when>2010-03-23 18:47:54 -0700</bug_when>
    <thetext>Created attachment 51470
HTML file that shows this bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>203304</commentid>
    <comment_count>4</comment_count>
      <attachid>51471</attachid>
    <who name="Andrew Wilson">atwilson</who>
    <bug_when>2010-03-23 18:50:25 -0700</bug_when>
    <thetext>Created attachment 51471
Associated JS file (worker script) that shows the bug.

Added worker-latency.html and worker.js files as attachments for this bug. Download both files into a single directory, load worker-latency.html in a browser, then hit reload to reproduce the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>620004</commentid>
    <comment_count>5</comment_count>
    <who name="Tony Gentilcore">tonyg</who>
    <bug_when>2012-05-09 16:30:52 -0700</bug_when>
    <thetext>This no longer reproduces using atwilson&apos;s test case. Worker loaded scripts come from the cache even after a reload. Please reopen with explanation if I&apos;m missing something.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>620015</commentid>
    <comment_count>6</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2012-05-09 16:38:43 -0700</bug_when>
    <thetext>Likely it works now due to Nate&apos;s changes here http://trac.webkit.org/changeset/98380 and subsequent related changes later.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>51470</attachid>
            <date>2010-03-23 18:47:54 -0700</date>
            <delta_ts>2010-03-23 18:47:54 -0700</delta_ts>
            <desc>HTML file that shows this bug</desc>
            <filename>worker-latency.html</filename>
            <type>text/html</type>
            <size>1134</size>
            <attacher name="Andrew Wilson">atwilson</attacher>
            
              <data encoding="base64">PGh0bWw+Cjxib2R5Pgo8ZGl2IGlkPXJlc3VsdD48L2Rpdj4KPHNjcmlwdD4KICBmdW5jdGlvbiBs
b2cobWVzc2FnZSkKICB7CiAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgicmVzdWx0IikuaW5u
ZXJIVE1MICs9IG1lc3NhZ2UgKyAiPGJyLz4iOwogIH0KCiAgbG9nKCJQcmltaW5nIGNhY2hlIGJ5
IHN0YXJ0aW5nIHVwIGluaXRpYWwgd29ya2VyIik7CiAgd29ya2VyID0gbmV3IFdvcmtlcigid29y
a2VyLmpzIik7CiAgd29ya2VyLm9ubWVzc2FnZSA9IGZ1bmN0aW9uKGV2dCkgewogICAgbG9nKCJD
YWNoZSBwcmltZWQiKTsKICB9CgogIHZhciBzdGFydDsKICB2YXIgbnVtV29ya2VycyA9IDEwOwog
IHZhciB3b3JrZXJzID0gW107CiAgZnVuY3Rpb24gc3RhcnRUZXN0KCkgewogICAgc3RhcnQgPSBu
ZXcgRGF0ZSgpOwogICAgY3JlYXRlV29ya2VyKCk7CiAgfQogIGZ1bmN0aW9uIGNyZWF0ZVdvcmtl
cigpIHsKICAgIHZhciB3b3JrZXIgPSBuZXcgV29ya2VyKCJ3b3JrZXIuanMiKTsKICAgIHdvcmtl
cnNbd29ya2Vycy5sZW5ndGhdID0gd29ya2VyOwogICAgd29ya2VyLm9ubWVzc2FnZSA9IGZ1bmN0
aW9uKGV2dCkgewogICAgICBsb2coZXZ0LmRhdGEpOwogICAgICBpZiAod29ya2Vycy5sZW5ndGgg
Pj0gbnVtV29ya2VycykgewogICAgICAgIGxvZyhudW1Xb3JrZXJzICsgIiB3b3JrZXJzIGNyZWF0
ZWQiKTsKICAgICAgICB2YXIgZWxhcHNlZCA9IChuZXcgRGF0ZSgpKS5nZXRUaW1lKCkgLSBzdGFy
dC5nZXRUaW1lKCk7CiAgICAgICAgbG9nKCJUb3RhbCBlbGFwc2VkIHRpbWU6ICIgKyBlbGFwc2Vk
ICsgIiBtcyIpOwogICAgICAgIGxvZygiQXZlcmFnZTogIiArIChlbGFwc2VkL251bVdvcmtlcnMp
ICsgIiBtcyIpOwogICAgICAgIGZvciAodmFyIGkgPSAwIDsgaSA8IHdvcmtlcnMubGVuZ3RoIDsg
aSsrKSB7CiAgICAgICAgICB3b3JrZXJzW2ldLnRlcm1pbmF0ZSgpOwogICAgICAgIH0KICAgICAg
ICB3b3JrZXJzID0gW107CiAgICAgIH0gZWxzZSB7CiAgICAgICAgY3JlYXRlV29ya2VyKCk7CiAg
ICAgIH0KICAgIH0KICB9CiA8L3NjcmlwdD4KCjxidXR0b24gb25jbGljaz0ic3RhcnRUZXN0KCki
PlN0YXJ0IFdvcmtlciBUaW1pbmcgVGVzdDwvYnV0dG9uPgo8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>51471</attachid>
            <date>2010-03-23 18:50:25 -0700</date>
            <delta_ts>2010-03-23 18:50:25 -0700</delta_ts>
            <desc>Associated JS file (worker script) that shows the bug.</desc>
            <filename>worker.js</filename>
            <type>application/javascript</type>
            <size>769</size>
            <attacher name="Andrew Wilson">atwilson</attacher>
            
              <data encoding="base64">b25tZXNzYWdlID0gZnVuY3Rpb24oZXZ0KSB7CiAgaWYgKGV2dC5kYXRhID09ICJwaW5nIikgewog
ICAgcG9zdE1lc3NhZ2UoInBvbmciKTsKICB9IGVsc2UgaWYgKGV2dC5kYXRhLmluZGV4T2YoImJ1
bGtzZW5kICIpID09IDApIHsKICAgIHZhciBudW1JdGVtcyA9IHBhcnNlSW50KGV2dC5kYXRhLnNw
bGl0KCIgIiwgMilbMV0pOwogICAgZm9yICh2YXIgaSA9IDAgOyBpIDwgbnVtSXRlbXMgOyBpKysp
IHsKICAgICAgcG9zdE1lc3NhZ2UoImJ1bGtzZW5kIik7CiAgICB9CiAgfSBlbHNlIGlmIChldnQu
ZGF0YSA9PSAicG9ydCIpIHsKICAgIHZhciBwb3J0ID0gZXZ0LnBvcnRzWzBdOwogICAgcG9ydC5v
bm1lc3NhZ2UgPSBmdW5jdGlvbihldnQpIHsKICAgICAgaWYgKGV2dC5kYXRhID09ICJwaW5nIikg
ewogICAgICAgIHBvcnQucG9zdE1lc3NhZ2UoInBvbmciKTsKICAgICAgfSBlbHNlIGlmIChldnQu
ZGF0YS5pbmRleE9mKCJidWxrc2VuZCAiKSA9PSAwKSB7CiAgICAgICAgdmFyIG51bUl0ZW1zID0g
cGFyc2VJbnQoZXZ0LmRhdGEuc3BsaXQoIiAiLCAyKVsxXSk7CiAgICAgICAgZm9yICh2YXIgaSA9
IDAgOyBpIDwgbnVtSXRlbXMgOyBpKyspIHsKICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2UoImJ1
bGtzZW5kIik7CiAgICAgICAgfQogICAgICB9CiAgICB9OwogIH0gZWxzZSB7CiAgICBwb3N0TWVz
c2FnZSgid29ya2VyIHJlY2VpdmVkIGludmFsaWQgbWVzc2FnZTogIiArIGV2dC5kYXRhKTsKICB9
Cn07Cgpwb3N0TWVzc2FnZSgic3RhcnRlZCIpOw==
</data>

          </attachment>
      

    </bug>

</bugzilla>