Ivan Ivković Posted July 10, 2012 Share Posted July 10, 2012 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? Quote Link to comment https://forums.phpfreaks.com/topic/265473-how-should-i-manage-my-css-files/ Share on other sites More sharing options...
Philip Posted July 10, 2012 Share Posted July 10, 2012 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.) Quote Link to comment https://forums.phpfreaks.com/topic/265473-how-should-i-manage-my-css-files/#findComment-1360530 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.