DEV Community

Cover image for The Need for Speed: HTML & CSS Tips to Boost Your Page Loading Time by 10x

The Need for Speed: HTML & CSS Tips to Boost Your Page Loading Time by 10x

devkoustav on November 02, 2022

We all hate it when our page loads this slow right! ๐Ÿ˜” Infact website conversion rates drop by an average of 4.42% with each additional second o...
Collapse
 
mrcaidev profile image
Yuwang Cai

Great post!
But I think "1.a Splitting CSS Files" may be hard to achieve when using modern CSS solutions like CSS modules or Tailwind CSS.
Anyway it's a good idea. Thank you!

Collapse
 
koustav profile image
devkoustav

Yes that's a problem in PostCSS plugins like Tailwind. The ways out are just minifying your CSS with a tool like cssnano, and compressing your CSS with Brotli. But hoping they will update something as such later!

Collapse
 
moazamdev profile image
Moazam Ali

Does using styled components in React (css in js) also speed up the application or website?

Collapse
 
koustav profile image
devkoustav

I don't think so. If you compare static css and styled components in react.... static css will be faster... because it is not processed during runtime.

However with every new versions React is getting better and better.

So in this case if you can compromise on your performance a bit... styled components in React may solve many other issues!

Collapse
 
moazamdev profile image
Moazam Ali

Ok @koustav, I got it.

By static css do you mean files with .css extension?

Using .scss files reduces performance or not? Because they are also processed (converted) into css first.

Btw thanks for your quick reply โค๏ธ

Collapse
 
pterpmnta profile image
Pedro Pimienta M.

Great advise, principal the image format.

Collapse
 
koustav profile image
devkoustav

Thanks

Collapse
 
rizkyzhang profile image
Rizky Zhang

Great post!

Collapse
 
koustav profile image
devkoustav

Thanks

Collapse
 
kosoko_daniel profile image
Oluwagbenga

This is great. Thank you.

Collapse
 
arsalannury profile image
ArsalanNury

my suggestion .
we can manage our API requests with tricks and libraries like React Query

Collapse
 
jonathandsouza profile image
Jona

I once tried to lazyloading content which is off screen and the SEO guy came for my blood.

Collapse
 
koustav profile image
devkoustav

Feeling something missing?
Put your suggestions in the comments ๐Ÿ˜„

I'll be happy to add your suggestions!

Collapse
 
koustav profile image
devkoustav

Did this post help you?
Save it for later...

lets_code_together

Collapse
 
dipanjan profile image
Dipanjan Ghosal

Yep. This was very helpful. Thanks

Collapse
 
toantd90 profile image
Toan Tran

Since you mentioned about coding splitting for CSS code, it is also good to inline critical css so the page could render. And then fetch and apply the remaining CSS.

twitter.com/iamakulov/status/12394...

fetchpriority is also a good choice even it is not supported by all browser now

Collapse
 
ra1nbow1 profile image
Matvey Romanov

Pretty nice :) But using GitHub fences for code fragments would be better.

<just like="this" />
Enter fullscreen mode Exit fullscreen mode
Collapse
 
fruntend profile image
fruntend

ะกongratulations ๐Ÿฅณ! Your article hit the top posts for the week - dev.to/fruntend/top-10-posts-for-f...
Keep it up ๐Ÿ‘

Collapse
 
cisnoral profile image
cisnoral • Edited

have you tried tailwind for additional css
I learnt and now started ipad reparature berlin

Collapse
 
hiruthicsha profile image
hiruthicSha

I kever knew there was a "media" attribute existed...๐Ÿ˜…

Great postโค๏ธ