Is it possible to inline critical CSS in the initial document load? #2068
-
In Lighthouse results for our Hydrogen app, one of the performance improvement opportunities is to render critical CSS in the initial document response. We have a primary style sheet that is loaded on each page, but this stylesheet requires an additional network hop after the server's document response. See a screenshot below of the network waterfall: First we load the initial document, then we load In an ideal world, all content in |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
@frandiox would it be possible to at least add a |
Beta Was this translation helpful? Give feedback.
-
At present you could roll your own cached fetch and then use We've done similar with cloudfront and a CSS file as well as some metafielded CSS content returned via an API call and an appropriate caching strategy in a server component. |
Beta Was this translation helpful? Give feedback.
@frandiox would it be possible to at least add a
<link rel="prefetch"
or something to that extracted CSS resource?