0

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 :) ?

abcde123483
  • 191
  • 1
  • 1
  • 7
  • You should most definately **not** include the jQuery script from code.jquery.com - http://blog.jquery.com/2010/12/30/hotlinking-to-be-disabled-on-jan-31-2011 - Instead use the Google or Microsoft CDNs. –  Aug 08 '11 at 13:10

1 Answers1

0

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.

Mike
  • 22,310
  • 7
  • 56
  • 79