I am using a number of jQuery plugins. Is it more efficient to reference them separately in the master page, or should I lump the contents of each file into a single jQueryPlugins.js file and reference that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, it is not more effecient.
Opening and Closing TCP connections is more expensive in terms of bandwidth, than downloading content while a connection has been established.
You most likely want to lump it in a file as well as minify it, using either YUI Compressor or Google Closure Compiler when referencing it.
Moreover, if you wanted to get hyper conscious of your bandwidth, you could include the minified content inline withinrevisiting this after a while.. this is wrong; @cameron has pointed out the reason.<script type="text/javascript"> </script>tags inside of your page.Note also: once the user has downloaded the single file, provided you have set up the appropriate Expires Header, your code will be cached. That way you don’t have to worry about referencing other files within your site or performance x-site.