: Is it still recommended to inline above the fold CSS with the adoption of http/2? For awhile now I've been following Google's recommendation here (https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery)
For awhile now I've been following Google's recommendation here (https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery) to inline critical above the fold CSS for faster load times. I was wondering, is this still going to be necessary with the adoption of http2 getting higher and higher? My reasoning is the way I understand it http2 allows for parallel requests across one connection so the CSS could start downloading right away? Someone please correct me if my understanding of how http2 works is wrong is wrong...
More posts by @Merenda212
2 Comments
Sorted by latest first Latest Oldest Best
The idea behind inlining for above-the-fold is still a good one because requests for CSS still take the same amount of time and pages are still blocked while the CSS file is being downloaded. HTTP/2 does not speed up downloads. It allows concurrent downloading. This way, images and other files are not tied up waiting their place in line but, again, it takes just as much time to download and execute or install them as before HTTP/2.
You are correct about the need to no longer inline CSS with the adoption of HTTP/2. As a matter of fact, HTTP/2 best practices suggest the opposite of inlining. The question that lingers for you and any reader of this post is, when is the right time to make this switch?
A change from inlining to no longer inlining (and the same would be true for image sprites) should really only be made after carefully assessing your users' browser/client capabilities to accept HTTP/2. Using analytics to inform your decision takes the guesswork out if this.
Over time I would not be surprised to see modifications to apache, mod_pagespeed, nginx, vanish and others to auto inline only for HTTP/1 clients/browsers. So, stay tuned to the version updates for major web servers to help automate this change.
For more information on HTTP/2, l highly recommend the changelog.com podcast about HTTP/2 with Ilya Grigorieva, the primary architect behind Google's http/2 efforts: listen to the interview here
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.