Github as a CDN?

Github is great for hosting code, git repositories, but it has other superpowers that often get overlooked.

I have recently been rethinking several technology stack components to see if they could serve a different purpose. GitHub has been my favorite for a while now. Github.com is the go-to service to host GIT repositories, used by software teams around the world to securely host their code bases.

This site is hosted on GitHub, using their ‘Github Pages’. It supports SSL (free) and custom domains. Using Jekyll for templating.

Recently I needed a place to dump some images from an AirTable project into a web storage solution that I could use on outside projects. AirTable is happy to host images, but their image paths have expiration timers. Basically, if you are on AirTable, all is good, the image URLs work. If you want to use the images off of their service, the URLs only function for 24 hours, then you get a 404 message.

No love. :(

Not AWS S3 Again

The traditional place to solve this image hosting requirement is on AWS S3. For several reasons, I am not an AWS fan. I wanted a simpler solution. Not code-free, but just not S3. (Using S3, with CloudFront service seemed too old school)

Github is my CDN

Hosting static HTML pages on GitHub is great, but it can also host images and files. Lots of them. So I uploaded a few images to a folder and committed them into a single-purpose git repository. This works, but the URL path is long and dirty. While it worked, it felt too tech-centric.

Just because GitHub was the host, did not mean I needed to send all that traffic to their servers.

So I started looking for a way to have a cleaner URL and cache the images, just as a CDN like S3+CloudFront handles images. Content Delivery Networks (CDN) spread your images around the internet and set up local caches that are fast to access.

A CDN Wrapper

I found TwicPics.com. This is a service that does just what AWS CloudFront does. It just does it all without having to set up an AWS account, set up IAM, and set up credentials. (The ‘CISO’ in me views AWS as a huge cybersecurity issue waiting to happen.)

So I signed up for a Twicpics.com account, set up a workspace, and set a URL path. The URL path gives me a cleaner URL to use in my ‘Low Code Cookbook’. The CDN proxies any requests to the actual GitHub Repo URL. This removes the Github URL from the image page.

Subscribe to keep reading

This content is free, but you must be subscribed to Low Code CTO to continue reading.

Already a subscriber?Sign In.Not now