-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Problem
Due to HTTP pipelining, content of a web page can be loaded/rendered before subsequent CSS files have been loaded. The end result is a semi-rendered page that "shifts" or "shimmers" once the CSS finishes loading / other CSS file fetches are completed. The same can apply to JavaScript.
HTML <link rel="preload"> solves this problem and is well-supported in all major browesrs (going back many, many versions). Reading Speculative loading may also provide additional benefits. (Note: do not mix up "preload" and "prefetch"! They are very different; in general "prefetch" is not needed these days.)
mdBook currently does not support a way to use preloading, which will result in the aforementioned behaviour.
Proposed Solution
Offer a way via TOML config to enable HTML link preloading. A default value of false (disabled) would be perfectly reasonable (i.e. retain existing behaviour).
Notes
No response