Bug 36399 - WorkerScriptLoader always (and unfortunately sometimes) inherits caching policy from the parent context.
Summary: WorkerScriptLoader always (and unfortunately sometimes) inherits caching poli...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-19 16:55 PDT by Dmitry Titov
Modified: 2012-05-09 16:38 PDT (History)
6 users (show)

See Also:


Attachments
HTML file that shows this bug (1.11 KB, text/html)
2010-03-23 18:47 PDT, Andrew Wilson
no flags Details
Associated JS file (worker script) that shows the bug. (769 bytes, application/javascript)
2010-03-23 18:50 PDT, Andrew Wilson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Titov 2010-03-19 16:55:05 PDT
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 "reloaded", 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'll create several workers. Note the printed time. Hit refresh. It'll create several workers again, this time taking longer for each one, for roundtrip to the server.
Comment 1 Darin Fisher (:fishd, Google) 2010-03-19 22:56:48 PDT
See http://code.google.com/p/chromium/issues/detail?id=34092#c10.  I don'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.
Comment 2 Alexey Proskuryakov 2010-03-19 23:02:14 PDT
See also: bug 32423, bug 30862. We seem to be having two opposite bugs at once.
Comment 3 Andrew Wilson 2010-03-23 18:47:54 PDT
Created attachment 51470 [details]
HTML file that shows this bug
Comment 4 Andrew Wilson 2010-03-23 18:50:25 PDT
Created attachment 51471 [details]
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.
Comment 5 Tony Gentilcore 2012-05-09 16:30:52 PDT
This no longer reproduces using atwilson's test case. Worker loaded scripts come from the cache even after a reload. Please reopen with explanation if I'm missing something.
Comment 6 David Levin 2012-05-09 16:38:43 PDT
Likely it works now due to Nate's changes here http://trac.webkit.org/changeset/98380 and subsequent related changes later.