I have a web page that references Bootstrap 4 from a CDN. In the head
of my HTML page, I have the following:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
That is the only CSS that I'm referencing. Yet, when I run Google's PageSpeed tool, I get the following error:
Eliminate render-blocking JavaScript and CSS in above-the-fold content Your page has 1 blocking CSS resources. This causes a delay in rendering your page. None of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources, or inline the critical portions of those resources directly in the HTML. Optimize CSS Delivery of the following:
https://maxcdn.bootstrapcdn.com/…trap/4.0.0-alpha.2/css/bootstrap.min.css
I feel like this is a chicken-and-egg issue. If I move this stylesheet reference to the bottom of my body
element, the page jumps from unstyled to styled when I visit the page. As a human, its quite jarring. Yet, when I do that, my PageSpeed score increases significantly.
Are there any alternative approaches? I always thought using a CDN was a good thing because it enabled you to take advantage of some caching features. But, this penalty seems to be quite significant.