Using GitHub for free Javascript and CSS hosting

Posted on October 17, 2017. Filed under: Uncategorized | Tags: , , , , , |

rawgit.com

When you request certain types of files (like JavaScript, CSS, or HTML) from raw.githubusercontent.com or gist.githubusercontent.com, GitHub serves them with a Content-Type header set to text/plain. As a result, most modern browsers won’t actually interpret these files as JavaScript, CSS, or HTML and will instead just display them as text.

RawGit acts as a caching proxy. It forwards requests to GitHub, caches the responses, and relays them to your browser with an appropriate Content-Type header based on the extension of the file that was requested.

See Example project using rawgit.com as hosting

Liked it here?
Why not try sites on the blogroll...