Log In · Register

 

Help Topic Rules and Requirements

For a list of all requirements and guidelines pertaining to posting a new Help topic, please click here.

This Month's Contests | Staff Member of the Month | Hosts Looking for Hostees | Hostees looking for Hosts | BigBookofResources

Submission Guidelines

Javascript
none345678
post Feb 15 2011, 01:26 AM
Post #1


Sex, Blood, & RocknRoll
*******

Group: People Staff
Posts: 5,305
Joined: Nov 2007
Member No: 596,480



Is it better to have one big JS file or to link to them separately?
 
 
Start new topic
Replies
Maccabee
post Feb 15 2011, 05:09 PM
Post #2


Senior Member
*******

Group: Official Designer
Posts: 5,880
Joined: Nov 2007
Member No: 593,382



One big file. Fewer http requests but the difference is so small it's not worth it because you lose the organization. Also look at this this:

http://rakaz.nl/2006/12/make-your-pages-lo...-css-files.html

You'd have to weight the pros and cons though because it reduces size therefore making it load faster but it also add pressure on the server which may end up making it slower. (It probably won't unless you have a really crappy server with a heavy load already.)

Lastly, read this. Every web design should read through it.

http://developer.yahoo.com/performance/rules.html
 
heyo-captain-jac...
post Feb 16 2011, 02:58 PM
Post #3


/人◕‿‿◕人\
*******

Group: Official Member
Posts: 8,283
Joined: Dec 2007
Member No: 602,927



QUOTE(Maccabee @ Feb 15 2011, 04:09 PM) *
One big file. Fewer http requests but the difference is so small it's not worth it because you lose the organization. Also look at this this:

http://rakaz.nl/2006/12/make-your-pages-lo...-css-files.html

You'd have to weight the pros and cons though because it reduces size therefore making it load faster but it also add pressure on the server which may end up making it slower. (It probably won't unless you have a really crappy server with a heavy load already.)

Lastly, read this. Every web design should read through it.

http://developer.yahoo.com/performance/rules.html

the way I figure I figure one big file is better for smaller sites but if you've got a lot of things going on but only need a few things on the home page, one or two more on the buy page, only one thing on a comments page, etc. then it's better to go with several smaller js files. say someone wants to browse your site for something but never goes to the checkout or comments sections it doesn't make sense to send them all that code anyway.

since js files are cached anyway, it's not like the handful who actually use everything will be making all that many http requests from 10 or 12 extra files
 

Posts in this topic
spambot   Javascript   Feb 15 2011, 01:26 AM
serotonin   yea   Feb 15 2011, 02:08 AM
spambot   you so helpful   Feb 15 2011, 02:15 AM
boot   I don't think it really matters on small-scale...   Feb 15 2011, 02:38 PM
Maccabee   One big file. Fewer http requests but the differen...   Feb 15 2011, 05:09 PM
boot   QUOTE(Maccabee @ Feb 15 2011, 04:09 PM) O...   Feb 16 2011, 02:58 PM
spambot   I have something like 9 js files...which I am assu...   Feb 15 2011, 05:54 PM
mipadi   Unless your site is getting something on the order...   Feb 16 2011, 04:38 PM
spambot   QUOTE(mipadi @ Feb 16 2011, 03:38 PM) Unl...   Feb 17 2011, 12:43 AM
mipadi   QUOTE(spambot @ Feb 17 2011, 12:43 AM) Ye...   Feb 21 2011, 07:32 PM
Maccabee   Check out Yslow for firebug.   Feb 17 2011, 12:30 AM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: