Jump to content

How should I manage my CSS files?


Recommended Posts

Should I attach pagename.css for each page or should I include all css rules in one css file?

 

My logic is if you load the huge css file every time, the page will be slower, and if you split them by purpose (for each page or widget), you'll get a faster output. Is that true?

Link to comment
https://forums.phpfreaks.com/topic/265473-how-should-i-manage-my-css-files/
Share on other sites

Not true. If you set your server settings correctly, a vast majority of the users will cache a larger file. Plus, the fewer the HTTP requests, the better off you are.

 

I tend to break out my CSS files by what they contain - base style, colors, forms, widgets, etc. Then on production all of those files are combined and then minified. Then my server has expiration set to expire in 365 days, with gzip enabled. This makes loading the pages a lot faster (minus the first page load from a visitor.)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.