Bug 125151 - Scripts loaded with yepnope.js are not cached
Summary: Scripts loaded with yepnope.js are not cached
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.9
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-03 06:06 PST by Jonathan Abourbih
Modified: 2013-12-03 06:32 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Abourbih 2013-12-03 06:06:44 PST
If a script is loaded via yepnope.js, even if appropriate cache-control headers are sent by the server, Webkit does not cache the response. This causes all scripts loaded with yepnope.js to download twice.

Actual behaviour: Scripts downloaded over SSL with yepnope.js are loaded twice, and are not cached, despite a long max-age header from the server.

Expected behaviour: Once a script has been downloaded, and the server has sent an appropriate cache-control header, the script should not be downloaded again.

Steps to reproduce:
1. Open the Web Inspector and begin recording a timeline.
2. Go to http://jsbin.com/ocuxum/6
3. Observe in the timeline that jquery.js (downloaded from Cloudflare) is downloaded twice, and the "Cached" column says "No".
4. Click "Refresh" to reload the page.
5. Observe that the "Cached" column still says "No" for jquery.js. Expected result is that it should say "Yes" and should not download again.

Note that a related issue has been logged with the yepnope.js project: https://github.com/SlexAxton/yepnope.js/issues/173.

Some background: Yepnope.js inserts an image tag in the page with the script URL to "prime" the cache with the scripts. Once the scripts have been downloaded, it then inserts <script> tags in the page in the appropriate order of execution.
Comment 1 Jonathan Abourbih 2013-12-03 06:32:10 PST
Edit: My description implies that this occurs only over SSL, but it does not. It occurs over regular HTTP or SSL.