I have a series of web pages that link to the following:


Not every page uses each .js (for example, not every pages uses jquery.ui.button) however I was wondering if it would make more sense to combine all of these files and minify them into a single.js file and include it on every page?

  • 3
    Probably will if you expect people to go to a lot of the pages. Browser caching should make it worthwhile. What kind of users are you serving? Commented Dec 1, 2011 at 19:20
  • Hmm I don't know...do you mean by browser? Seems mainly to be IE7 and Chrome. Commented Dec 1, 2011 at 19:45
  • I don't have a lot of experience minifying...do I just take all the pages, combine it into one page, and run it through a minifier? Commented Dec 1, 2011 at 19:45

5 Answers 5


Yes, you should combine the files.
Just use the custom download builder to select the parts you need, and it'll do it for you.


You should combine and minify these.

As per your comment to your question, there are tools that can help with this but essentially yeah, putting them all into one file and running a minifier will do the job.


One thing to consider is that total download size is not the only factor that will determine how long it takes to load a page. Each additional, external .js file is a separate server request for download, so load times will be impacted beyond the simple size of the file.

Google Page Speed has an excellent segment on how combining (or not) external files can impact page load time, using the concept of 'Round Trip Time.' Even beyond round trip, some older browsers do not allow parallel file downloading, and will block additional content from loading until all scripts are downloaded and executed.

Hope this helps!


I like the Google Closure Compiler ( http://code.google.com/closure/compiler/ ) for combining and minifying javascript files.

I don't use any advanced features.


You can also link to the jQuery files on http://cdnjs.com/ which is a free CDN hosting the most common jQuery and plugin js files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.