TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

JQuery google api and other google hosted javascript libraries.

40 pointsby alexyimalmost 15 years ago

4 comments

Encosiaalmost 15 years ago
When using this CDN for versioned libraries like jQuery, be sure to avoid using the "latest version" references[1][2].<p>In order for the "latest version" feature to be reliable, they have to avoid users having stale local copies for very long. Thus, they serve those with a much closer expires header, which defeats one of the shared CDN's biggest benefits.<p>When you reference the full version explicitly[3], it's served with a +1 year expires header.<p>// Not cached for long.<p>[1] <a href="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js</a><p>[2] <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.j...</a><p>// Cached for up to a year.<p>[3] <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min...</a>
评论 #1492507 未加载
rodion_89almost 15 years ago
Exactly necessary was it to implement this site in Flash? It's quite a bit of overkill for such a simple app.
评论 #1492081 未加载
nhebbalmost 15 years 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.
评论 #1492192 未加载
marcusboosteralmost 15 years ago
I find this page more convenient: <a href="http://code.google.com/apis/ajaxlibs/documentation/index.html" rel="nofollow">http://code.google.com/apis/ajaxlibs/documentation/index.htm...</a>
评论 #1492205 未加载