Convert GitHub Files into Raw CDN Assets with RawGit
There are thousands of new projects and features on GitHub to play with. However, developers like to move fast and it’s annoying to download all these files locally just for testing.
This is where RawGit comes in handy. This free web app lets you convert any file from a GitHub repo to an externally-hosted CDN.
Read Also: Cloud Hosting & CDN Services for Web Developers – Best of
The RawGit web app is super easy to use and it works for every GitHub repo.
First, you should find a repo you want to use that doesn’t have a CDN link. In this case, I’ll choose this CSS3 modal which is pretty simple.
Then dig through the file structure to find the exact files you want externally. For example, this stylesheet is all we need for this modal window effect. So, copy/paste that URL into RawGit and voila!
A full URL ready to go that you can copy/paste as needed.
Notice there are two different URLs here. The first is a CDN production URL that you can actually use on live websites. This runs through a StackPath CDN, so the files can be served quickly across the globe.
On the other side, you’ll find a development URL which is still hosted online, but it doesn’t pass through a CDN. It’s not optimized for high performance but it works great for local testing or cloud-based IDE development.
You can’t go wrong with either link and they both work flawlessly for testing smaller GitHub repos.
The development URL does have built-in throttling for excessive traffic and high volume requests. This can lead to problems down the line but if you’re working on a smaller project you shouldn’t notice any issues.
RawGit is one of the best inventions for modern web development. You can pull any file from any GitHub repo and get it hosted online with proper Content-Type headers. Definitely a must-have resource for all serious frontend developers.
If you have any questions or just wanna send your thanks you can shoot a quick tweet over to the official Twitter account @rawgit.
Read Also: Amazon CloudFront – How To Setup CloudFront To Work With S3