Bundle CSS to Load Page Faster
By Fahad Ahammed
- One minute read - 147 wordsA test with a simple HTML page over a DSL connection shows that one big stylesheet or css of 50 KB can speed up load time by factor 2 compared to five stylesheets that are 10 KB each in size:
- 5 Stylesheets (10KB each): 1100ms
- 1 Stylesheet (50KB): 500ms
So , How to make them one without breaking or editing them ? I am going to show you how to do this .
Let you have 5 Stylesheet or CSS :
- style1.css
- style2.css
- style3.css
- style4.css
- style5.css
Normally they are like this in your page :
Assuming those css files are in “css” folder .
Now create a php file where index.php is , naming “css.php” and put below codes :
Save this file . And remove :
from your page and replace with :
And save that page . Now you can check by Google PageSpeed Insight .