https://raw.githubusercontent.com/rgrove/rawgithub/master/public/img/sushi-large.png

RawGit (GitHub) is a service of caching proxy. GitHub used to serve raw files with proper Content-Type, but they have been dealing with hotlinking, and that’s why browsers eventually saw these files as text/plain as they were told. The repository owners should use GitHub Pages to host the files, which serves file properly.

So, when GitHub took this measure to combat against hotlinkers, whatever it’s consented by the repository owners or not, some people didn’t fond of using Pages or simply didn’t understand, or had no clue about Pages.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr969d58GgZi0hEs48EiNWvN2UjA5fgWu_7D9Kyd5XypZm-ZzSxYOFBpFK_CoThU0wDCmFg2oEcOSPkHt9F2ZI9T1xm8-p2IHHqe3EI1FDjrRRKdBIFpejL-HemYRpLbHa_cCBb_Ge6Ls/s640/2014-04-18--07%253A33%253A50.png

Anyway, RawGit was created to allow still somewhat using raw URL. Yes, you will get a different URL since the cached files ain’t served by GitHub.

The issue with GitHub on this is because some repository owners kindly release their projects as open source, which are used in browser, however, frankly, many ain’t serving the files nor do they even create a gh-pages. So, say you are looking for a JavaScript library, are you going to clone? Or would you prefer to link to the original source?

I choose latter. Unfortunately, there is no easy way. For instance, without RawGit, I would not be able to use a TTF in a blog post with application/x-font-ttf content type. You should read its FAQ page for more details.

It also provides a Stats page, you probably can see it as an alternative GitHub trending or explore. You can see which project’s files are used for real, or who’s very naughty and being punished by evil.js and evil.css.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs2ObxGnJtNv2kDNC5aI4iu_t_q2XNX7zYbkCtE74-7WOfmexER8-dqapb6kGXDsuo4LU_6XEruBcPsF75MUgnbJGx0igpo6v8p8tFYiYhJKGexj83HRKg38IVRuL4hKsyz7T4SxGGdDk/s640/2014-04-18--07%253A35%253A12.png

Their are two types of usage, one is for development for testing or examples, another is for production for large amount of traffic, which is currently in beta stage. Here is the raw URL of RawGit logo, which redirects to raw.githubusercontent.com:


https://github.com/rgrove/rawgithub/raw/master/public/img/sushi-large.png
https://raw.githubusercontent.com/rgrove/rawgithub/master/public/img/sushi-large.png

The cached links by RawGit:


https://rawgit.com/rgrove/rawgithub/master/public/img/sushi-large.png
https://cdn.rawgit.com/rgrove/rawgithub/master/public/img/sushi-large.png

For development, it’s just s/\/github\.com/\/rawgit.com/ and remove raw/, very simple to obtain. For production, just prefix a cdn sub-domain after development link and you will get the file.

RawGit is created by Ryan Grove in JavaScript with NodeJS, under the MIT License.