Skip to content We're live on Product Hunt today Upvote
install

diagnostic · one of 36 free, no counter

Head order

Is anything in this head in the wrong place?

The head is one of the few places in HTML where order has consequences. A charset declared after the first kilobyte means the parser has already guessed; a render-blocking stylesheet before a preconnect wastes the connection; a viewport meta after a stylesheet means the first layout used the wrong width. All three are ordering bugs and none of them show up anywhere else.

Reach it Press + K on any tab and type head order. Ctrl + K on Windows and Linux

What is in the head, in the order the parser met it
reads the head, in parser order
writes nothing
sends nothing
groups twelve kinds folded into five - a new kind is a row
filtering folds a run into a marker, never renumbers the head
findings each one carries its own fix
plan free
section#about

What this actually is

On any page whose startup is slower than its size explains, after any change to a tag manager, and whenever a <meta> has been added by a plugin that put it wherever it liked.

section#asked

Asked about this diagnostic

Why does the charset have to be early?

Because the parser has to guess an encoding until it is told, and it only reads the first kilobyte looking. A charset after that point means the guess already happened.

Does filtering renumber the head?

No. A filtered run is folded into a marker carrying its count, so the positions you see are the positions in the document. A filter that renumbered would make every finding’s position wrong.

Is a preload always an improvement?

No, and it is reported rather than graded on that basis. A preload for something the parser would have found anyway competes with what it is preloading against.

What about tags a script adds later?

They are in the reading, because the reading is of the head as it stands. Whether they were served or injected is what the Mutations diagnostic answers.

how to use head order

  1. Open Head order to read the head in parser order rather than as source.
  2. Look for the three that cost: a late charset, a blocking sheet before a preconnect, a late viewport.
  3. Each finding carries its own fix. Apply them in the order the parser meets them.
  4. Re-run after any tag-manager change - that is where a <meta> gets inserted wherever it likes.