
RawGit – GitHub CDN system - opusdie
http://rawgit.com/#doc
======
chr1
The 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.

------
thejosh
Don'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
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. The files aren't served static from github:
[https://github.com/blog/1482-heads-up-nosniff-header-
support...](https://github.com/blog/1482-heads-up-nosniff-header-support-
coming-to-chrome-and-firefox)

EDIT: I mixed up the move of Pages to .io, updated with the right blog post.

~~~
itafroma
> 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)

------
grrowl
It'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
Well 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_.

------
joeblau
Another 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.

------
timtamboy63
This has existed for a while as rawgithub.com. Super useful, great to demo
things that are in progress.

------
AdrianRossouw
That'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-
fa...](http://daemon.co.za/2014/03/from-trenches-js-cdn-point-of-failure/)

~~~
timdorr
If 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
Yes, 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
Also, using an external CDN will end to more downtime.

You'll never benefit from having your CDN up if your own servers are down.

------
mmahemoff
It'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
Secret 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.

------
thomseddon
This 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 !

------
daGrevis
Here'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/ev...](https://github.com/rgrove/rawgithub/blob/master/public/js/evil.js)

------
j15e
See also everydayimmirror.in :
[https://github.com/jbourassa/mirrorin](https://github.com/jbourassa/mirrorin)

------
Splendor
This 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!

------
balls187
Isn't yaypie (dude behind RawGit) one of the people on Evil.js?

~~~
rgrove
Nope, I just use it.

------
fibo
Just use gh-pages

