5 ms·
Cdnjs - the missing cdn
- rojotek 14y agogreat CDN for all the stuff that you want that isn't on google or other CDN's.
- jtokoph 14y agohttp://news.ycombinator.com/item?id=2828516 http://news.ycombinator.com/item?id=2828516
- ckluis 14y agoThat's pretty awesome! I've always wondered why popular css grids weren't also CDN'd. Bootstrap, 960, etc, etc - it makes great sense to have many of these things cached across 100s of sites 1 time - instead of 100 times. Modify the cdn version in a seperate style sheet afterwards.
- deleted 14y ago[deleted]
- deleted 14y ago[deleted]
- ambirex 14y agoThe same people who are doing the cdnjs have been planning do a CSS one as well, https://github.com/cdnjs/cdncss https://github.com/cdnjs/cdncss
- ryankirkman 14y agoYep. We plan on launching the css component our our offering in the near future.
- ckluis 14y ago<tears of joy>Yay!</tears of joy>
- deleted 14y ago[deleted]
- alexchamberlain 14y agoI've just submitted a pull request with both versions of normalize.css. https://github.com/cdnjs/cdncss/pull/15 https://github.com/cdnjs/cdncss/pull/15
- alanbyrne 14y agohttp://www.bootstrapcdn.com/ http://www.bootstrapcdn.com/ This seems to work well for me.
- jvehent 14y agoWho pays for this ? How do I know you're not going to replace some of that javascript with malicious content ?
- dpcx 14y agoHow do you know Google/Microsoft won't either?
- jvehent 14y agoBecause their stocks would go down very quickly if they did.
- BarnabasLAL 14y agoYou know, I'm just cynical enough to believe that security problems have little or no bearing on stock price. However, reputation is a kind of stock too, so from that perspective I agree, public CDNs like these have little to gain and lots to loose by tampering with these libraries to inject, say, a behind-page pop-up with ads.
- ryankirkman 14y agoCloudflare pays for this. They've been sponsoring cdnjs for around a year now. As for the security of our system, all javascript files are verified against official sources before going on the cdn. Additionally, we have many library maintainers submitting updates to their own libraries. Beyond that the only question remaining is our personal integrity. Like any relationship with a third party, you're going to have to decide whether trusting us is an acceptable level of risk. If past performance is any indication of integrity, we have had no security incidents since we began in January 2011.
- adambenayoun 14y agoI assume you are the creator of cdnjs - what are your relation with cloudflare beyond just the sponsorship? Are you working for them? Do you advise them? I'm wondering what is the performance increase delivered by cloudflare. I've heard many mixed opinions and I'm at the interesection where I have to decide whether I'm using them or others. btw - kudos to Cloudflare for sponsoring this - seems like a great way to put yourself in front of developers.
- Nux 14y agoOk, I'm not a developer and I'm probably missing the big picture or smth; my question: - All this fuss is about hosting a few text files none bigger than several KB?? Who in this world does NOT afford to host a few small files nowadays?
- weego 14y agoIt's more about client performance through using shared cache assets than cost. Though I always worry about someone at a supposedly secure system (online banking for example) thinking its a bright idea as well.
- dasony 14y agoThe idea is that users wouldn't have to download the same jquery or whatever script over and over for every site they visit. It makes less sense when it comes to not-so-popular script files, but I guess there's a convenience factor too.
- Nux 14y agoOk. So I didn't miss anything obvious. :-) This might have been handy back in the dial-up days, but not now. Now I see it as a security and stability risk.
- benjiweber 14y agoCDNs get the content cached closer to the end user than you are likely to be yourself. Round trip time is especially important when you're loading several assets in a single page. CDNs also often provide higher availability than you can provide yourself Using someone else's CDN is considerably cheaper than serving resources yourself. e.g. Using jquery from google cdn. Bandwidth costs for "small" javascript files start to add up once you have 100 million people loading it each day.
- rachelbythebay 14y agoWe need to extend the baseline notion of what the web is. If some nontrivial number of sites are using (say) jQuery, then it would be a good idea to have a way to declare "SCRIPT SRC jQuery version x.y.z" and let the browser figure out where it lives. Then you fetch it once, parse it once, and run it many times, no matter what site you may be visiting. Or at the very least, we need some way to say "get this script from this URL, but only if it hashes to <this value>, since otherwise it's been compromised". Why worry about CDNs when you can design the script-switcheroo attack right out the system in the first place? I wrote about this in June: http://rachelbythebay.com/w/2012/06/27/src/ http://rachelbythebay.com/w/2012/06/27/src/
- josteink 14y agoFor every one of these CDNs you use, chances that people with scriptblockers will use your site goes down. When I see that a site tries to resolve scripts from 50 domains, for what should really just be static HTML, I generally leave. So please. Don't use CDNs. If you want people to trust you, host your own damn stuff on your own domain.
- vidarh 14y agoUsers that care, or even notice, are so few that you are noise compared to the number of users that will leave if the site loads slower, so the CDN is likely to be a net win many times over.
- sergiotapia 14y agoYou are in the vast minority. A tremendously small percentage of users will actually care about a non-issue like that.
- Nux 14y agoUnfortunately he is in vast minority. Only when you start using NoScript or generally paying more attention to your browser's status bar do you start to realise the scale of the ridiculousness.
- ebiester 14y agoIf I ever ran a media site, I'd redirect noscript users to this: "We love that you've come to value the great material we provide, but we make money off of advertizers. If you run noscript, that's great! We totally support noscript options for those who purchase a subscription plan."
- MatthewPhillips 14y agoSubscriptions would not support the development costs of that.
- mkoryak 14y agoand here is the other 'missing' cdn that does the same thing and has been around longer: http://cachedcommons.org/ http://cachedcommons.org/ :)
- erwanl 14y agocdnjs has been around for a while already.
- mkoryak 14y agocachedcommons claims to have been around since 2009. cdnjs claims to have been around since 2011. Im not saying one is better than the other, but i am implying that cdnjs is not 'the missing cdn'.
- jonny_eh 14y agoNo SSL support? I'll stick with cdnjs.com
- Maxious 14y ago"This website is offline No cached version is available" definitely missing ;)
- muxxa 14y agoMochiKit isn't listed: http://mochi.github.com/mochikit/download.html http://mochi.github.com/mochikit/download.html
- mdlthree 14y agoWhat do providers get for access to these type of files? Can they capitalize on the information gathered from file requests? Adding to their knowledge of traffic patterns etc...
- criswell 14y agoI like the simple new design. Everything that I need is there and nothing more. Huge improvement over the last design.
- debacle 14y agoNeeds more wu.js http://fitzgen.github.com/wu.js/ http://fitzgen.github.com/wu.js/
- sabat 14y agoFrom what I've gathered, you can fork cdnjs, add it, and do a pull request.
- fintler 14y agoI really thought this was going to be related to cjdns. https://github.com/cjdelisle/cjdns https://github.com/cjdelisle/cjdns
- BarnabasLAL 14y agoI suppose if you have a big trust issue letting Cdnjs host your libraries or if you have a customized build of one, you could just do what they did and sign up for CloudFlare and control the files yourself. [edit: CloudFlare, not Cloudfront]
- ceejayoz 14y ago"This page (http://cdnjs.com/ http://cdnjs.com/) is currently offline. However, because the site uses CloudFlare's Always Online™ technology you can continue to surf a snapshot of the site." Well, that's hardly comforting.
- Sidnicious 14y agoFWIW, the libraries they host still seem to be getting served normally, so that’s a good thing.
- ceejayoz 14y agoSort of. I'm still not sure I want to use a CDN that can't keep its main site up. How do I know their .js files won't expire out of the CloudFlare cache before the site comes up, for example?
- ryankirkman 14y agoIt doesn't work like that. The CDN portion is completely independent of the website. The website is really just an index of the files on the CDN.
- zhoutong 14y agoI always prefer compiling and gzipping the whole site's assets to just one .js and one .css file and serve them through CloudFront. It's usually around 100-200 KB and CloudFront's latency is very low at most places. This saves a lot of requests and waiting time between page loads (i.e. the first page is always slower, but subsequent page loads take almost no time because there're very few (or even just 1) requests needed to make.)
- mpd 14y agoWhat about old versions? Taking the jQuery url, and changing it to the version previous to the newest release (1.7.2), 404s on me. This is a showstopper. http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery-1.8.0.min.js http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery-1.... - ok http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery-1.7.2.min.js http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery-1.... - 404
- jsdalton 14y agoHa, you and I noticed the same thing just moments apart. Hopefully someone will reply on this thread to our question, because I can't imagine having to upgrade all of my projects immediately whenever a new version of any library was released. EDIT: Looks like the URL pattern just changed slightly for jQuery. 2.72 is still around: http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.mi... Looks like they host back to 1.6.1, probably when the library was added to the project: https://github.com/cdnjs/cdnjs/tree/master/ajax/libs/jquery https://github.com/cdnjs/cdnjs/tree/master/ajax/libs/jquery
- jsdalton 14y agoWhat's the policy on previous versions of libraries? I noticed, for example, that only the latest version (3.1) of the jQuery plugin Nivo Slider is available. The last versions (<= 3.0.1) are returning 404s. Given that the previous version was released in May 2012 that's an insanely fast deprecation policy for a CDN. I have to guess that either I've stumbled upon a bug or minor oversight in this case, because I can't see how removing old versions that quickly would be at all a workable solution for 99% of use cases...
- jonny_eh 14y agoMaybe they'll only support version that were released from the date that library was added to the CDN. In other words, hopefully once a library+version are added to the CDN, it's supported for a long long time.
- jsdalton 14y agoYes, I think you are correct. Digging deeper, I see that libraries are added via pull request and that the Nivo Slider library was added 11 days ago. Other libraries that have been there longer (such as jQuery) continue to have old versions.
- ryankirkman 14y agoWe'll host any version of any library. It's just that no one typically adds versions of libraries older than we currently host.
- ryankirkman 14y agoOnce a library is hosted it stays hosted forever.
- moe 14y agoHint: If you want to brag about your uptime ("100%") then you should monitor that with a HTTP-request and not an ICMP Ping. The latter is rather deceptive because it's not actually testing service availability.
- px1999 14y agoLooks really useful at serving the stuff that you can't find anywhere else (and for whatever reason don't want to host yourself), but IMO it really needs a TOS / license - I'm guessing that I can use it on personal sites, but can I use it on commercial sites, can I use it on SaaS sites, or sell sites that use it, etc etc?
- acconrad 14y agoFront-end guy here, curious about CDN access on mobile - is it faster to serve one CSS and one JS minified file through a private CDN (like CloudFront), or use something like CDNJS to make concurrent CDN calls with many smaller files spread across a connection?