Multiple CSS Files and Performance

Would it be wise to merge all CSS into one file? Will there be an increase in productivity. I must assume that the HTTP request is made so that each file is loaded on the initial page load, and reducing these requests would seem to make sense.

Is there any reason not to merge all css into one file? (e.g. maintainability or other performance issue)

+6
performance html css
source share
5 answers

Combining all your css files into one absolutely improves performance. Whether this performance is noticeable depends on your workload, number of requests, etc. For an average blog, this will be close to zero.

Read Best Practices to Speed ​​Up Your Website at Yahoo! Developer This will explain things better than I can.

As you say, the reason for not merging css files is maintainability. However, there are many tools that automatically merge and reduce your css files into one.

You should check out the YUI Compressor , this will help you merge and minimize your css files.

+5
source share

Would it be wise to merge all CSS into one file? Will there be an increase in productivity. I have to assume that an HTTP request is made to receive every file when loading the start page, and reducing these requests seems to make sense.

Yes, but create a combination during assembly or runtime and do not try to support one file if you started with several.

In addition to the number of HTTP requests, it is also important to set the correct expiration headers in the response.

Is there any reason NOT to combine all css into one file? (e.g. maintainability or other release characteristics)

It is not necessary to maintain a single file, but it is useful to maintain a single file because CSS data is merged anyway.

YUI Compressor is a good tool to minimize JavaScript and CSS.

+1
source share

Would it be wise to merge all CSS into one file? Will there be an increase in productivity. I have to assume that an HTTP request is made to receive each file when loading the start page, and reducing these requests will make sense.

Yes Yes Yes.

Is there any reason not to merge all css into one file?

Not

(e.g. maintainability

Combine them during assembly, not during development, and there will be no maintainability issues.

0
source share

If not all pages need all the CSS, then splitting them into multiple files can be faster.

Maintaining health becomes a problem if the CSS file becomes really huge, when different teams need to coordinate their work on it.

0
source share

Perhaps there is another reason: DO NOT combine files:

If the combined stylesheet gets too large, Internet Explorer 9 ignores some styles.

See: IE 9 ignores CSS rules

0
source share

All Articles