Hacker News new | ask | show | jobs
by EGreg 3667 days ago
What I wonder is why not have a heavily cached, canonical version of each jQuery library, and every other library as long as it is used on a lot of sites? These days the browsers cache the bytecode, which is almost as fast as shipping native code with the browser.

I think google used to host those things. It automatically becomes more cached the more it is used.

https://developers.google.com/speed/libraries/

The downside is that with a referer header, you then let some centralized DNS know your site is being visited by a new visitor.

What we really need is my httpc:// proposal. The c stands for constant. Download once from a seed and cache the file. Guarantee it's always the same. Or web browsers should support magnet links.

1 comments

Actually those CDNs for libraries like jquery don't have as high of a cache hit rate as you'd think.

The problem is that there is a pretty wide number of versions of each library that are used. Combine that with the fact that mobile caches are still laughably small (like 5-50mb on some phones), means that it's not really helping all that many people.

As for the caching stuff, there was a push for that with html imports (basically treating all imports with the same name as the same, so if you and another library needed jquery, they could both use the one in your cache without needing to re-import it), but I haven't heard anything on it for a while, and i'm not sure if that's even a goal any more.