Last Updated: February 25, 2016
·
516
· lockedown

Save HTTP requests with better CSS

This one is nothing groundbreaking, but yet I see many developers not taking advantage of it.

If you can, combine all of your CSS into one stylesheet. There really isn't a good reason to have a separate call for a Reset.css, Style,css, MediaQueries.css...well, you get the point.

Another things that people may not realize is that using @import in your stylesheet also incurs a HTTP request.

Why should this matter?

Well, for one, about half the traffic is on mobile these days, and it's only going to increase. Saving those extra requests shaves precious milliseconds off of your load time. Unless you are a site with the ubiquity of a Google, Facebook, or Twitter, chances are people will just as soon bounce from your site if it takes more than 3 seconds to load. In fact, studies prove this over and over, and those large sites I mentioned before are obsessed with fast load times.

This is a really simple fix, with big gains, which is a good place to start making our sites and apps better for everyone.