4 ms·
RawGit – GitHub CDN system
- fibo 13y agoJust use gh-pages
- AdrianRossouw 13y agoThat's really useful. I've wanted this exact thing a couple of times. They say not to use this CDN for anything production related, but I personally think you shouldn't be using any public JS CDN for anything that matters. reasoning here : http://daemon.co.za/2014/03/from-trenches-js-cdn-point-of-failure/ http://daemon.co.za/2014/03/from-trenches-js-cdn-point-of-fa...
- timdorr 13y agoIf you check the bottom of the page, you'll see they've set up a production-ready CDN via MaxCDN: http://rawgit.com/#cdn http://rawgit.com/#cdn
- AdrianRossouw 13y agoYes, I recommend not using using any public cdn. That includes cdnjs, google hosted libraries, maxcdn. anything. I think that you will inevitably end up needing to host code that uses the external dependencies, and you should host your libraries from the same 'place' that your code ends up on. It's about data locality and reducing moving parts.
- madeofpalk 13y agoAlso, using an external CDN will end to more downtime. You'll never benefit from having your CDN up if your own servers are down.
- AdrianRossouw 13y agoThinking about it now, if you could host your own code via the CDN (which this implies), that's perfectly fine with me. It's late =P I'm leaving my sibling comment untouched since my point still stands.
- thejosh 13y agoDon't use it for production they say, then you look at the sites on http://rawgit.com/stats.html http://rawgit.com/stats.html and facepalm.
- klapinat0r 13y agoNot to be the buzz kill, but the reason raw.githubusercontent.com is text/plain and X-Content-Type-Options: nosniff is to keep people from using it as a CDN, because: it's not. The files aren't served static from github: https://github.com/blog/1482-heads-up-nosniff-header-support-coming-to-chrome-and-firefox https://github.com/blog/1482-heads-up-nosniff-header-support... EDIT: I mixed up the move of Pages to .io, updated with the right blog post.
- itafroma 13y ago> Not to be the buzz kill, but the reason raw.githubusercontent.com is text/plain and X-Content-Type-Options: nosniff is to keep people from using it as a CDN, because: it's not. Right, but nothing about this disputes or takes issue with that. The purpose of RawGit is to provide a drop-in replacement URL for use cases where such linking would be desirable from a dev or testing standpoint: it reads the raw version and then serves it statically. There's a CDN option as well: http://rawgit.com/#cdn http://rawgit.com/#cdn
- j15e 13y agoSee also everydayimmirror.in : https://github.com/jbourassa/mirrorin https://github.com/jbourassa/mirrorin
- mmahemoff 13y agoIt's useful, but I really want it to host secret (unlisted) Gists. I'm hoping JSBin will do so soon. There's a promising issue about it (https://github.com/jsbin/jsbin/issues/1094 https://github.com/jsbin/jsbin/issues/1094) and it will be an ideal tool for semi-private code demos as well as markdown writing if supported.
- rgrove 13y agoSecret gists are supported. If you've got a raw secret gist URL that's not working, let me know. Probably best to tweet @yaypie or @rawgit; I don't look at HN often.
- balls187 13y agoIsn't yaypie (dude behind RawGit) one of the people on Evil.js?
- rgrove 13y agoNope, I just use it.
- Splendor 13y agoThis is one of those services that I didn't realize I needed until I saw it and now I can't believe it didn't exist. Thanks!
- timtamboy63 13y agoThis has existed for a while as rawgithub.com. Super useful, great to demo things that are in progress.
- grrowl 13y agoIt's very useful and nice, but the emphasis on "if you use it too much we'll serve evil.js" makes me nervous — I somewhat trust you, random guy on the internet, but I think you talk about this more than I'd like. Edit: The best analyogy I can think of is it's like going on a date with someone who talks about their ex- constantly. Not bad in itself but enough to make you think twice.
- anon4 13y agoWell yes you wouldn't want a lasting relationship with that guy, but I only really need him for one evening so I don't show up to the dance without a date. Because then I'd just look silly.
- hayksaakian 13y agoIf you read further down, there is a production friendly option
- chr1 13y agoThe link should be changed to http://rawgit.com/#cdn http://rawgit.com/#cdn. New part is at the very bottom about version that can be used in production cdn.rawgit.com, but most comments here seem to miss that part.
- daGrevis 13y agoHere's source of evil.js that will be served if you are going to abuse rawgit.com and use it on production. https://github.com/rgrove/rawgithub/blob/master/public/js/evil.js https://github.com/rgrove/rawgithub/blob/master/public/js/ev...
- thomseddon 13y agoThis is just rawgithub.com on a new URL right? I suppose they changed when github stopped using the raw.github.com host, so although this makes it a little more generic, it's lost the biggest usability advantage it had in that you could just delete the dot between "raw" and "github" and hey presto. All together - wish this was on rawgithubusercontent.com !
- joeblau 13y agoAnother handy alternative to this site is http://cdnjs.com/ http://cdnjs.com/ and their repo is located here: https://github.com/cdnjs/cdnjs https://github.com/cdnjs/cdnjs. This is typically what I use to offload hosted JS to a CDN although CloudFlare does a very good job. I had a problem early on with MaxCDN which powers http://www.bootstrapcdn.com/ http://www.bootstrapcdn.com/. While building http://gitignore.io http://gitignore.io, I had one pretty bad outage just as I was trying to promote the site so I first switched to cdn.js and then to CloudFlare and have been happy ever since.