Announcement

Collapse
No announcement yet.

jQuery: What's The Best Way To Call It

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    jQuery: What's The Best Way To Call It

    Hi there, Everyone:

    I am interested in using a image zoom scrip that requires the jQuery library.

    Is there any "BEST" way to call the jQuery library? The version I would like to use is 55K, and while that is not huge, I would like to try and get my pages to load as fast as possible.

    Should I use gzip? It brings the file down to only 19K, but I don't know how much time will be saved when it has to be uncompressed.

    Should I host it locally? Or should I link to the google hosting of jQuery?

    Do I have to do anything to ensure that it is "cached" when a visitor loads it the first time?

    Thanks in advance.
    Mark Romero
    ~~~~~~~~

    #2
    Re: jQuery: What's The Best Way To Call It

    We call the Google API's and never have a problem:

    Code:
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    
    <!-- Official Version -->
    
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
    Only difference is the tool used to minify the library - Google used their own GCC and JQuery proper uses UglifyJS. We use Google because high availability is all but guaranteed since it's on about a million edge servers.

    Comment


      #3
      Re: jQuery: What's The Best Way To Call It

      Also, code.jquery.com doesn't support HTTPS whereas Google and Microsoft's CDNs do. Pretty important factor with ecommerce sites

      Comment


        #4
        Re: jQuery: What's The Best Way To Call It

        Thanks for the responses, guys.

        any reason that you don't host it on your own server?
        Mark Romero
        ~~~~~~~~

        Comment


          #5
          Re: jQuery: What's The Best Way To Call It

          CDNs have a few benefits:
          1) Allows for more connections (@see http://yuiblog.com/blog/2007/04/11/p...search-part-4/)
          2) CDNs are geographically closer to your users
          3) The HTTP headers are typically smaller (no cookies, etc.) than if you sent it from your normal domain
          4) Its bandwidth you don't have to pay for

          1 and 3 can be faked using a subdomain (or 2) and for most people 4 is kind of a non-issue. The real key is #2.

          Comment


            #6
            Re: jQuery: What's The Best Way To Call It

            Thanks Brandon!
            Mark Romero
            ~~~~~~~~

            Comment

            Working...
            X