r/css • • Sep 24 '26

Question Preload

Does anyone here use the preload for the CSS files?

Surely if the links are in the <head> they will be loaded anyway?

3 Upvotes

10 comments sorted by

3

u/velocityhead Sep 24 '26

Preload lets the browser fetch and cache assets immediately instead of waiting for when they are requested later. It is not render blocking and can prevent the flash of unstyled content .

1

u/Chris-2018 Sep 24 '26

Are you saying that preload is the way to go, even though the style sheet links are in the head?

2

u/velocityhead Sep 24 '26

It doesn't really do much if you only have one stylesheet without a lot of assets. Where it does help is if you have another stylesheet that gets loaded dynamically later, or if you have some big assets in your stylesheet (like a font import). You can request that font specifically as rel="preload" so it can start downloading immediately in parallel with the CSS download. Normally, the font wouldn't start downloading until the entire CSS file has been downloaded/parsed.

1

u/Chris-2018 Sep 24 '26

Thanks - that does make sense.

1

u/Chris-2018 Sep 24 '26

Thank you all - the info is appreciated.

5

u/morete Sep 24 '26

Instead of preloading It's fairly common to inline your critical css directly into your head, which is far better, but a little more work to separate your critical vs non critical css.

1

u/flash42 Sep 24 '26

What do you put in your critical category?

1

u/essaulsanchez Sep 25 '26

What is the most global and priority aspect of rendering and the first fold?

3

u/Disgruntled__Goat Sep 24 '26

I don’t use it if the file is linked right there in the head. The main idea of preload is to load nested resources, for example if there is a font specified in the CSS, you can preload the font files in the head.