Description
Details
- Read the Docs project URL: https://readthedocs.org/projects/insipid-sphinx-theme/
The RTD theme is not used, therefore badge_only.css
is loaded.
Expected Result
Faster page load?
Actual Result
I don't know if that makes a meaningful difference, but the file https://assets.readthedocs.org/static/css/badge_only.css is loaded right at the beginning of the page load, even though the HTML elements it applies to are inserted into the page much later.
This seems like a waste, doesn't it?
I've played around with https://pagespeed.web.dev/, which reports potential savings of 780 ms (maybe to be taken with a grain of salt, but anyway).
I'm not at all an expert at any of this, but I've read that the CSS can be deferred with something like this:
<link rel="preload" href="my_style.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="my_style.css"></noscript>
The <noscript>
fallback is probably not even necessary, since the "badge" itself is loaded with JavaScript.
Has something like this been considered before?