Bug 102936 - Lookahead parser should evaluate Link header for rel=prefetch/stylesheet/script
Summary: Lookahead parser should evaluate Link header for rel=prefetch/stylesheet/script
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 194539
Blocks: 51940
  Show dependency treegraph
 
Reported: 2012-11-21 06:38 PST by Nicholas Shanks
Modified: 2023-01-25 05:02 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas Shanks 2012-11-21 06:38:11 PST
Modern best practice is to put the scripts a page uses at the bottom of the document, as long as they do not use APIs like document.write()
Doing so requires that the look-ahead parser scan through an entire document before finding them. As an experiment, my web app now emits this:

HTTP/1.1 200 OK
Link:</style/common.min.css>;rel=stylesheet prefetch, </scripts/common.min.js>;rel=script prefetch

...response body...


however no difference above the statistical variance was noticed in the timing of speculative resource requests.

Anecdotal:
See http://stackoverflow.com/questions/3641581/link-rel-script-usage for comments about rel=script