Better HN
topnewbestaskshowjobs
Log inSign up

Comment

by colinm · 13y ago · 0 comments

Probably 4kB more than loading jQuery from cache :)
Comments
leandono13y ago
Yep. But with jQuery, the browser parse 91kb of JS, this is the difference...
youngtaff13y ago
Sort of, many modern JS engines use lazy parsing, so don't actually parse the contents of a function until it's needed.
dclowd990113y ago
Are people really referencing jquery from other servers in production environments?
adventured13y ago
Yes, it's extremely common to call jQuery from, for example, Google's googleapis.com domain.

Here's a quick sampling from a random group of top sites:

stackoverflow.com (googleapis.com), kickstarter.com (googleapis.com), cnn.com (their own cdn), businessinsider.com (jquery.com), foxnews.com (their own cdn), nbcnews.com (aspnetcdn.com), espn.com (espncdn.com), tumblr.com (secure.assets.tumblr.com), lastfm.com (googleapis.com), lyricsmode.com (googleapis.com), reference.com (sfdict.com, cdn for ask etc), qz.com (googleapis.com), theverge.com (googleapis.com), ehow.com (googleapis.com), wikia.com (googleapis.com), chacha.com (googleapis.com)

toble13y ago
Just a passing tinfoil comment... Google has so many fingers in the analytics pie, if you're not being recorded by Adsense or Analytics, then there's always CDN.

No idea if it's all linked up, but it means that using alternative search engines doesn't really matter if you still visit Google-enhanced destinations.

eps13y ago
Of course it's all linked up, including other freebies such as Google Fonts. Why else would they be offering it for free.
EzGraphs13y ago
See https://en.wikipedia.org/wiki/Content_delivery_network.

Use of these (to serve static content) reduces your server traffic/load and gives a faster response times to users in different geographical regions.

dclowd990113y ago
I definitely understand the benefit. I also understand the very serious drawbacks of not hosting content that you own. Compared to an initial load time that borders on completely negligible, I'd rather guarantee safety of user information and not having downtime coincide with the shared cdn.
nawitus13y ago
That was what I was thinking. What's the selling point since jQuery is already cached?
rschmitty13y ago
At one time jquery wasnt cached... and when you want to use a new version of jquery, there goes your cache anyways.

Doesnt seem like a really big argument against, especially considering the size of the library for the first non-cache hit

ricardobeat13y ago
On average > 50% of visitors have an empty cache.
mtrimpe13y ago
Let's hope this one will soon just be a cache hit as well then ;)