Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS when to inline your entire stylesheet when using critical path rendering CSS Reply To: when to inline your entire stylesheet when using critical path rendering CSS

#210155
Alen
Participant

The paragraph about that goes back and forth a bit but I believe that with inlining they mean placing it in the head section. Then it would still be cached of course. @shikkediel

No it wouldn’t. When you link to a resource like .css once the file is downloaded by the browser it is stored in browser cache. So if the user was on the home page and they navigate to different location the same .css will not be downloaded, instead loaded from the cache.

So if you place your entire stylesheet in the head, this means, that each time this document is requested, since the data is in the head, it will be downloaded each time, as part of the HTML.

So I did some initial testing on my own site with inlining my entire stylesheet in the head and have not really seen any performance improvements. @pkinchla

Please be careful about what you are measuring.

Any other general tips or thoughts would be much appreciated.

Have you tried Service Workers.