4 ms·
I don't usually like to host my JavaScript elsewhere such as on the Google CDN. Are there any web standards in the works where you can specify a hash of a file
by pwnna 13y ago
I don't usually like to host my JavaScript elsewhere such as on the Google CDN. Are there any web standards in the works where you can specify a hash of a file to be cached regardless where it is?
- jol 13y agoI haven't seen one, but that would be very beneficial, it would not only make everything faster, but also avoid the privacy concerns and remove the additional point of failure that external CDN creates.
- pwnna 13y agoAbsolutely. Actually in that case we could just do something like this: <link rel="stylesheet" hash="b6792c2dcaafc7678f18236f6e7289152756a14f" href="...."></link> Now that I look at it.. where do we suggest this to the web people?
- MatthewPhillips 13y agohttp://lists.w3.org/ http://lists.w3.org/
- sp332 13y agoYou could use a magnet "link" (which is really just a hash anyways) to pull the file from the Kademlia DHT.
- jol 13y agowell, that would not work well with backwards compatibility, also it adds extra protocol to implement to browser vendors (extra bugs, here they come :)
- alanctgardner2 13y agoWhy, pray tell? Isn't the Google CDN: - faster for people in different geographic areas - at least as reliable as your infrastructure - already cached (this would be nullified by your proposal) I ask because normally I wouldn't think twice about using the Google CDN libraries.
- jol 13y agoyou are right about first, but >- at least as reliable as your infrastructure this doesn't mean that Google CDN is down the same times that your server is, thus it adds downtime (or time when something is broken in the site), i.e. if your server doesn't work, nothing works, if your server works but CDN doesn't, again something is broken and if this time doesn't overlap, it is just additional risk, even if tiny one. Also, what happens when Google decides to charge for use of the CDN?
- estel 13y agoIgnoring the last point, this is probably why the HTML5BP loads from the CDN but fallsback to a local version if the CDN can't be reached.
- nucleardog 13y agoIt's fairly trivial to load jQuery/other libraries from the Google CDN and fall back to a local copy if it fails as long as you're not using async/deferred. We've got it baked into our boilerplate. If Google decides to charge for use of their CDN, then I wish them luck. They don't have any billing information and short of serving a bastardized jQuery (simply not serving it will trigger the fallback) our projects will continue as they've always been.
- pwnna 13y agoYou're also passing off your user's information to someone else. It's a minor concern, but for some people that might be important.
- djs070 13y agoGenuinely interested - what information?