Bug 102936
| Summary: | Lookahead parser should evaluate Link header for rel=prefetch/stylesheet/script | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Nicholas Shanks <nickshanks> |
| Component: | Page Loading | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ap, beidson, koivisto, me |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=194539 | ||
| Bug Depends on: | 194539 | ||
| Bug Blocks: | 51940 | ||
Nicholas Shanks
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
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |