If you are trying to improve Web performance, don't put a bunch of <link rel=preload> tags for scripts before <meta charset=utf-8>. Pushing <meta charset=utf-8> beyond the first 1024 bytes is worse than not having <link rel=preload>s for scripts.
Could you elaborate on "the penalty from late <meta charset=utf-8> is larger in Firefox than in Chrome"? What kind of performance impact is there exactly?
FWIW we've been codifying this best practice in @h5bp: https://github.com/h5bp/html5-boilerplate/blob/master/dist/doc/html.md#the-order-of-the-title-and-meta-tags … and I've filed https://bugs.chromium.org/p/chromium/issues/detail?id=1028041 ….
-
-
When Firefox has inspected the first 1024 and still hasn't seen the encoding declaration, it assumes a legacy encoding andnstarts parsing. If it then finds a meta, it reloads, so there's the cost of the reload.
-
Chrome's meta prescanner continues to until it (by using approximation) believes it has reached the end of head / start of body. So the cost is not starting the real parse (that would actually start subresource loads) until having waited for more main resource bytes.
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.