Home > page speed > Hosting of jQuery script, which makes more sense with respect to page load time?

Hosting of jQuery script, which makes more sense with respect to page load time?

August 8Hits:1
Advertisement

I'm thinking about whether it makes more sense to include the http://code.jquery.com/jquery-latest.min.js file from the jQuery website, rather than hosting it on your own server, since 1st time visitors probably already have the jquery-latest.min.js from jquery.com downloaded and will be able to use a cached version of it, so page load time will be a bit faster.

Does anyone know how this works and want to share their thoughts? Do you think it is irrelevant or could there be some milliseconds to gain :) ?

Answers

most browsers will make anywhere from 4-6 parallel get requests to the same hostname to get css/js/images from the server. So if all your assets point to the same hostname then offloading the jquery one might be a good idea for speed for those that do not even have it cached cause the browser will make an additional get request after the 4-6 to get your assets.

The better place to link the file is the google cdn though

http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js

That way the download will happen from a server closer to the user.

Related Articles

  • Hosting of jQuery script, which makes more sense with respect to page load time?August 8

    I'm thinking about whether it makes more sense to include the http://code.jquery.com/jquery-latest.min.js file from the jQuery website, rather than hosting it on your own server, since 1st time visitors probably already have the jquery-latest.min.js

  • jquery filer adding existing images to the list on page loadJanuary 10

    JQUERY Filler creates image boxes upon selection of each image. However i need to create those boxes from array of image names which i receive from php on page load. So user can add some more images or remove the existing ones. Here I receive the ima

  • How to get a jQuery script to run on a page?June 26

    I am having a hard time figuring out how to get a jQuery script to run on a Wordpress page of mine the "correct" way. I have followed this article and implemented what the first answer says to do. There are so many tutorials and articles I've re

  • Changing .click to a on page load. Need some jQuery adviceJanuary 27

    Right now a plug-in will sign me into the back-end CMS of the site from the front end when I move my mouse to to top right of the screen and hover. I had to embed a back-end only plug on the front end to meet a clients needs and when the page loads a

  • Using GPL licensed jQuery scripts on website with adsDecember 19

    I'm making a web application that will generate revenue from displaying ads. The system is meant for me to run and not sold/distributed to anyone else. My questions are: Can I use GPL licensed jQuery scripts on the website? Can I use GPL licensed scr

  • Reload Jquery scripts after an AJAX request October 14

    I have a bit of code where I am looping though all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouseon/off. This happens on page ready and works just fine. The problem I have is that any

  • How do I activate jQuery/script on demand?March 10

    I am trying to use jQuery to display the comment-section of my Wordpress-pages, but without requiring that jQuery be present on all pages that allows comments. Basically, I need the following: A generic javascript implementation of the 'in view' jQue

  • What's the correct way to include files in Wordpress TwentyTen theme with it's own jquery scripts and css?April 11

    I want to include a slider in the default Wordpress theme on the home page. I did manage to get the page to show using <?php if ( is_home() ) { include ('slider.php'); } ?> but it doesn't look like it's loading the jquery script it needs or the styl

  • Reduce Your jQuery Script Loading Times

    Reduce Your jQuery Script Loading TimesMay 4

    Hi guys, I've stumbled upon a jQuery script that reduces the loading time of your JavaScript include files. It works by loading all your dot js files at the same time inside an array. I've tried the tests out and it does seem to load much quicker tha

  • Trying to remove duplicate jquery scriptsSeptember 3

    I've added this <?php wp_enqueue_script("jquery"); ?> before <?php wp_head(); ?> so that I can just use the wordpress included jquery script, and deleted the extra jquery script I've been loading, but when I go to Inspect Element in

  • How to Run a jQuery Script after a Javascript Script has Finished in WordPressSeptember 29

    I've got javascript (a) and jQuery script (b). I need (b) to run after (a) has finished running. I need them to run sequentially. How do I do that? In wp_enqueue_script, I've made (b) dependent on (a), but it appears that (b) runs before (a) has fini

  • jQuery script to clear input fieldsDecember 8

    I've been trying to write a jQuery script where when someone clicks on the input the space clears and then if they don't type anything in, it reappears. This is what I came up with. Is there a better way to do this? If so why is it better? $(document

  • How can i reload jQuery scripts after form submit in views using ajax?March 3

    I have a views with ajax enabled using B.E.F. to filter some content. After submitting these filters jquery scripts stop working. Please help me to find an answer how to reload any of these scripts after using submit button with ajax? I`ve tried to d

  • WebDriver: Can I inject a jQuery script for a page that isn't using jQuery?March 27

    Is it possible to inject a jQuery script into a page if the page isn't already using jQuery? We have a few pages in our sites where we don't add jQuery if it doesn't need it, but I'm using it to automate the page with WebDriver. I don't want to test

  • Need help with adding jQuery script to WP and calling script to pageMarch 31

    I've written a pretty simple jQuery script, and I don't know how to call it. It's in its own directory. First, how do I register it, and then how do I enqueue it? I assume that's the order it's done in, and that registering it basically means that it

  • Remove jquery script October 6

    Possible Duplicate: How do I update jQuery to the latest version I can download? In Firefox I get an unresponsive script error from Google hosted jquery but can't echo the problem on other browsers. I just looked at the source of drupal and it's load

  • Adding inside wp-plugin jQuery script that receives JSON-formatted data, generated by php-function inside this pluginDecember 27

    I'm trying to add Highstock chart in my plugin. It requires input data in json format. But I have some troubles with default json parser in jQuery. I've already read this article, but still can't understand how can I add the chart in the plugin. Can

  • Clean up jQuery script March 11

    I combined multiple jQuery scripts into one script. This script converts a <ul> element to a <select> box (for use in Response WebDesign). But I think this script is not well written, can someone help me clean up this script? (function($) { $(

  • How to add jQuery script to a custom visual webpart?May 21

    Similar to some previous questions, I'm trying to use jQuery in a visual web part but I keep getting that jQuery is undefined. I've added the jQuery script to SiteAssets as well as a script folder inside my visual webpart project, and tried referenci

  • Hook with jquery script is not working in wp-admin August 6

    This is the hook and script Im using, the jquery script itself is working as you can see in this fiddle: function my_custom_admin_footer(){ echo ' <script type="text/javascript"> jQuery(document).ready(function($) { $(".checkIt")

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.511 s.