One big JS file OR multiple smaller JS files - What's better for users?
I'm faced with a situation where I've to decide whether to include multiple JS files (minified and compressed) Vs packing them all together in a single compressed and minified JS file.Â
The obvious answer is to have single compressed JS file so that we drastically reduce the number of HTTP requests made to the server. But there's a problem with that approach.
In my situation, we've jQuery as the 'base' file that's required everywhere. Then my custom JS forms the rest 20% of the code. If I combine everything into just one file - and change even 1 character in it - the users will have to re-download the entire JS file (99.99% of the unchanged code) again.Â
If I split the files, users will have to download only the smaller file that has been updated.Â
Have you faced similar situation? What's your recommended approach?
Tagging: #-Link-Snipped-#â , #-Link-Snipped-#âÂ