jaymc Posted March 18, 2009 Share Posted March 18, 2009 I have a lot of javascript files on my website. My question is, once they have visited the page hence all the .js files cached etc, will it slow down the page the fact that I have my javascript script split up in multiple files as appposed to 1 master <script src="/java/jquery.3.1.2.js" type="text/javascript"></script> <script src="/java/jquery.simplyscroll.js" type="text/javascript"></script> <script src="/java/moorainbow/mootools.js" type="text/javascript"></script> <script src="/java/moorainbow/mooRainbow.js" type="text/javascript"></script> <script type="text/javascript" src="/java/flashobject.js"></script> <script type="text/javascript" src="/java/global-v5.js"></script> <script src="/java/popup.js" type="text/javascript"></script> <script type="text/javascript" src="/modules/flirtchat/js/config.js"></script> <script type="text/javascript" src="/modules/flirtchat/js/cookies.js"></script> <script type="text/javascript" src="/modules/flirtchat/js/fly.js"></script> <script type="text/javascript" src="/modules/flirtchat/js/dc.js"></script> <script type="text/javascript" src="/java/up_down_tooltip.js"></script> <script type="text/javascript" src="/java/drag.js"></script> I mean I could merge all the javascript code togeter in one file call java.js but its not very good to manage if I need to make changes. Quote Link to comment Share on other sites More sharing options...
Psycho Posted March 18, 2009 Share Posted March 18, 2009 Having multiple files should not make a perceptible difference. I would guess there would be some additional time involved due to the renegotiation to find the file and start the transfer, but I think we're talking microseconds. If you really want to know the impact - do a test. Assign getTime() to a variable before you load the external files and then assign getTime() to another variable after you load them - then check the difference. Then for comparison, put all the JS into one external file and run the test again. Quote Link to comment Share on other sites More sharing options...
emehrkay Posted March 18, 2009 Share Posted March 18, 2009 having multiple files affects load times. http://www.webdigi.co.uk/blog/2009/avoid-javascript-blocking-content-download-on-your-website-during-page-load/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.