1

Is there a difference when we use files that are already stored somewhere(like Google hosted libraries or fonts) than the ones that are stored on local servers for our web pages, like differences on performance perspective?

vephelp
  • 552
  • 2
  • 10
  • 24
  • Possible duplicate of [Why should I use Google's CDN for jQuery?](http://stackoverflow.com/questions/2180391/why-should-i-use-googles-cdn-for-jquery) – PurkkaKoodari Feb 21 '17 at 20:05

2 Answers2

2

Yes, there are a few differences. In most of the scenarios, your page will load much faster because:

  • If your browser already has a cached version of the library for some other site, it won't load it again.
  • Your browser may connect to Google or other CDN servers simultaneously, which may not happen if you are loading from your server.
  • The latency in getting the file from a Google server is almost always significantly shorter than with your server.
  • You will also have reduced load on your server.

The scenario where you may want to host on your site is if you are serving content for countries where Google, Google's CDN or similar are blocked.

PurkkaKoodari
  • 6,703
  • 6
  • 37
  • 58
Kiran
  • 5,478
  • 13
  • 56
  • 84
1

Yes, these is small difference exists. Modern browsers has limit, for example: no more than 4 parallel downloads from one domain. So, if you will use fonts from Google CDN servers, it possible, page will load little bit faster.

user2443795
  • 144
  • 7
  • ow so if you download from google, its a different domain so you get to download another file from your domain simultaneously? correct? – vephelp Jan 14 '14 at 15:48
  • Exactly. For example, page loads: html (from your server); CSS (from your server); fonts (from Google); jquery library (from Google); some images sprite (from your server); your custom JS (from your server). Only 4 files from your server, but page almost loaded. – user2443795 Jan 14 '14 at 15:50