1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Downside to Jquery with Google

Discussion in 'XenForo Questions and Support' started by jellytoe, Nov 3, 2015.

  1. jellytoe

    jellytoe Member

    Title says it all. Is there a downside to hosting Jquery with Google?
     
  2. Jeremy P

    Jeremy P Well-Known Member

    Pros:
    • Visitors may already have Google-hosted jQuery cached from another site
    • Google's CDN means the user may be able to download it faster
    Cons:
    • Potential additional DNS lookup if the file is not cached

    However, it seems unlikely that a visitor would have the exact same version of jQuery cached because the version of jQuery used by XenForo is nearly two years old (1.11.0), and the amount of CDN speed-up to download what amounts to 33kb of text is probably negligible.

    It probably won't help or hurt much, but you can try testing both with https://gtmetrix.com to be sure.
     
    jellytoe likes this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    jellytoe likes this.
  4. adwade

    adwade Active Member

    I tripped across the same article a few days ago and was wondering where I should share the information about it on here? Image my surprise when I saw the link above already on here! ha, ha @Jake Bunce That is quite a talent to post an answer, before I can even come up with an inquiry about such. ;)

    In part, the article reads...
    "I urge you to use the Google Hosted Libraries content delivery network to serve jQuery to your users directly from Google’s network of datacenters. Doing so has several advantages over hosting jQuery on your server(s): decreased latency, increased parallelism, and better caching.
    In this post, I will expand upon those three benefits of Google’s CDN and show you a couple examples of how you can make use of the service…"(continued)​
     
    Last edited: Nov 25, 2015
  5. Amin Sabet

    Amin Sabet Well-Known Member

    I've tested and find that using the default self-hosted jQuery is, on average, fastest for my sites.

    Ymmv - worth it to do the testing!
     
    Last edited: Nov 26, 2015

Share This Page