4 ms·
While the advantage of referencing the google api files is that your browser can take advantage of cached copies, Google Webmaster Tools recommends reducing the
by nhebb 16y ago
While the advantage of referencing the google api files is that your browser can take advantage of cached copies, Google Webmaster Tools recommends reducing the number of DNS lookups if you do so. I recently worked through all the PageSpeed and YSlow flags and saw a decent bump in traffic afterward. It could be coincidence, but I had a long history of stable traffic, so the timing seemed too coincidental.
- Encosia 16y agoajax.googleapis.com is being referenced on so many sites now that many, if not most, visitors will have the DNS resolution cached.
- nhebb 16y agoExactly. It would be nice if GWT and PageSpeed took that into account because they're sending mixed messages.
- btmorex 16y agoNot that I doubt that, but how would you even go about measuring such a thing? Obviously, there's a cost to using google version too (DNS lookup + one more point of failure). It would be nice to have real numbers for what percentage of visitors actually have the libraries cached. Remember, that the files are versioned and they're also serving less popular libraries than jquery. My guess is that it would be slower to use the google version for some library/version combos. The question is which ones.
- Encosia 16y agoI ran a crawler on the Alexa top 200,000 a couple months ago, measuring how many sites referenced jQuery and how many used a CDN. I haven't published the results yet, but will be sure to submit that post here when I write it. Keep in mind that the version fracturing doesn't increase the likelihood of a DNS lookup.