iamamirsalehi's avatar

Is it a good idea to mix a lot of files?

Hey there, I have some directory that includes over 10 CSS and javascript files, The question is Should I mix them into a single file or just put them in the public directory?

0 likes
2 replies
bugsysha's avatar

Depends on their use. If you need all of them all the time then mix them and set not to expire that often. If you need only few of them then leave them separated.

1 like
tykus's avatar
tykus
Best Answer
Level 104

A single concatenated asset file each comprised of your various CSS and JS resources will mean fewer network requests; so the result should be a faster first page load. You also can take advantage of automated minification, purging and autoprefixing (amongst other build steps).

1 like

Please or to participate in this conversation.