Would it be wise to somehow combine all of my JavaScript files into one?

Discussion in 'JavaScript' started by uleesgold, Mar 3, 2012.

  1. #1
    for the sake of fewer HTTP requests. its not urgent for the site I have in mind since its pretty small yet but for optimization it has got to be good practice.
    scriptfiles.PNG

    I noticed when looking at the source code that some variables in different files have the same names.
     
    uleesgold, Mar 3, 2012 IP
  2. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #2
    I haven't seen your site but I would assume you could get rid off 1.6.2, 1.6.2.min, 1.7.1, and the 2.0.6.min you are loading here files double and there is no need for it.
     
    stephan2307, Mar 5, 2012 IP
  3. Co1dFusion

    Co1dFusion Peon

    Messages:
    33
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yep you should combine them, but keep in mind the extra bandwidth it might take. If you only need them for a few pages, there is not point having extra stuff download on page that dont need them
     
    Co1dFusion, Mar 6, 2012 IP
  4. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #4
    Yes, you should! You can save some bandwidth and loading time, try to use Minify in combining them..
     
    JohnnySchultz, Mar 6, 2012 IP