-
Notifications
You must be signed in to change notification settings - Fork 46
Resource hints are misprioritised in the reorderhead transformer #391
Copy link
Copy link
Open
Description
The reorderhead transformer puts the resource hints at the back of the head (see entry (8)):
// ReorderHead reorders the children of <head>. Specifically, it
// orders the <head> like so:
// (0) <meta charset> tag
// (1) <style amp-runtime> (inserted by ampruntimecss.go)
// (2) remaining <meta> tags (those other than <meta charset>)
// (3) AMP runtime .js <script> tag
// (4) AMP viewer runtime .js <script> tag
// (5) <script> tags that are render delaying
// (6) <script> tags for remaining extensions
// (7) <link> tag for favicons
// (8) <link> tag for resource hints
// (9) <link rel=stylesheet> tags before <style amp-custom>
// (10) <style amp-custom>
// (11) any other tags allowed in <head>
// (12) AMP boilerplate (first style amp-boilerplate, then noscript)
This means that resource hints that are provided to meet the performance guidelines in the Amp documentation will reordered to only appear after the actual download triggers they are meant to optimize.
I think that either the entry (8) should be brought up to appear after (0) in general, or resource hints should be split into two groups where the Amp-related ones are brought higher while the rest stay in (8).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels