DEV Community

Cover image for Using GitHub as a Content Delivery Network
Amit Merchant
Amit Merchant

Posted on β€’ Originally published at amitmerchant.com

2 1

Using GitHub as a Content Delivery Network

This is a quick write up on how I've started utilizing GitHub as a Content Delivery Network(sort of) and how you can do the same.

Usually, CDNs are used to have a content delivered on your website in a fast manner and to save some space on your server from resources such as images, documents etc. I've tried to use GitHub as a CDN for somewhat similar reasons. I'm running this blog on GitHub pages and as you might know GitHub only allows contents under 1 GB per repository. I didn't wanted to utlize my GitHub page's site's storage to store images that I end up using on the blog. So, I've figured out a way.

Repository as a CDN (RaaC) [?]

I thought of creating and using an another GitHub repository where I would store all the image resources and which can act as a mean to deliver content on my blog whenever requested. I created a repository named cdn which is actually a bare bone repository. I would add images and resources in here.

Now, as I've configured my GtHub pages site to work with my custom domain, I can easily access any content on this site using URL https://www.amitmerchant.com/cdn/<resource name in the repos>. For instance, There's an image called bulb-min.jpg exists in the repository which I can access using the following URL: https://www.amitmerchant.com/cdn/bulb-min.jpg

And there you have it! Your free and instantly available CDN ready to use in few clicks. Easy-peasy!

This way I can save up the space on my original GitHub pages site which I don't want to get exhauted under 1 GB of limit and in case if the "cdn" repository also gets exhasuted, I can always create an another repository named "cdn2" or something like that. ;)

In closing

I'm sure many here will find this funny but trust me it's highly functional and one can surely use it as a CDN alternative which they can spin up in minutes. I hope this would be useful for someone who is looking for a quick CDN service. :)

Until next time!

Originally published at https://www.amitmerchant.com/using-github-as-content-delivery-network/

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

πŸ‘‹ Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay