3 ms·
You know what I would love to have the HTML5 guys add to the spec? Some way of keeping libraries like PrototypeJS and jQuery in the browser cache at all times,
by pjscott 16y ago
You know what I would love to have the HTML5 guys add to the spec? Some way of keeping libraries like PrototypeJS and jQuery in the browser cache at all times, so that pages could just use them without worrying about the size.
Perhaps some kind of alternate src attribute on script tags, so you could list a local copy (for reliability) as well as Google and Microsoft CDN URLs, and the browser would go with the first one it had in its cache. And if individual browsers wanted to distribute jQuery (et al.) along with the browser itself, and define an URN for it, so much the better.
This is just something I thought up in the past few minutes, so take it with a grain of salt, but as a web developer, I would love this.
- mikeklaas 16y agoWhy isn't it sufficient to use the Google-hosted jQuery? It's likely to be cached.
- tjpick 16y ago1. a boatload of page view info you are sending off to google 2. it's another dependency that you don't control
- michaelbuckbee 16y agoTo your first point, is this a critique of the speed (pushing info up to Google) or to Google sucking in yet more information? If it's the latter I'm already in trouble because almost everything I do uses Google Analytics, but I can see the point if you're doing something else. WRT your second point, there's a middle ground of pointing to Google's hosted version for speed and falling back to a local copy if it is not found. You can see the technique in use within the Boilerplate HTML5 template - http://html5boilerplate.com/ http://html5boilerplate.com/ - Scroll down to the index.html file, line 58.
- jonknee 16y ago1) They set far in future expires header, so they should see very very little of your page view info.
- nl 16y agoIn HTML5 you can do this by keeping a script in LocalStorage, then executing it on-demand. It could also have a fallback mechanism for network loading (and lazy initialization). The implementation of this is left as an exercise for the reader.
- steveklabnik 16y agoWouldn't you be able to do this with the cache manifest? http://diveintohtml5.org/offline.html http://diveintohtml5.org/offline.html