Support

Find answers, guides, and tutorials to supercharge your content delivery.

GitHub Pages CDN Integration

Updated on October 4, 2018
GitHub Pages CDN Integration

Some CMS solutions (static page generators) are built on GitHub Pages, such as Jekyll. GitHub Pages and Jekyll are valid solutions up to a certain traffic and storage volume, however there do exist some limitations. Jekyll generates static pages based on Markdown, Liquid, HTML, and CSS. The static pages are predestinated for full site acceleration which makes static site hosting with a CDN extremely simple.

Implementing a GitHub Pages CDN integration can help optimize asset delivery to users globally and better improve your overall website's performance.

GitHub Pages limitations

GitHub Pages makes it easy for someone to generate a site for their project for free and with minimal effort. However, the following limitations of GitHub Pages might force you to use an alternative solution for hosting your web content:

  • Maximum file size of 100 MB
  • Repositories below 1 GB
  • Risk of account deactivation if traffic is above average usage.
  • Expiry is set to 10 minutes, which is bad performance-wise.

Although GitHub Pages' main advantage is its price point (free), the above limitations may not be acceptable for certain projects. For example, blogs that use many images or other large resources will quickly meet the 1 GB GitHub size limitation. Therefore using one of the alternatives mentioned below for your GitHub CDN integration may prove to be a more acceptable solution.

GitHub Pages alternative

KeyCDN offers you two options to perform a GitHub Pages CDN integration. Either use a Pull or Push Zone to accelerate your content. We are focusing here more on the implementation of a Pull Zone. What you need is an origin server where you can host your static pages generated by Jekyll. Here are the origin server options:

Once an origin server is selected, integrating your site with a CDN is simple and can be done by following the instructions linked in the above options. The Pull Zone integration method automatically detects which files should be accelerated by the CDN and therefore rewrites your origin URL with the CDN URL. This process requires no manual uploading of files and allows you to quickly get started in accelerating your static content. However, if you do not want to move to a new hosting provider, the following section offers a second GitHub CDN integration option.

GitHub CDN integration

We recommend to offload your heavy assets to a KeyCDN Push Zone in case you want to maintain your GitHub Pages site. This method can be used to accelerated a downloadable resource, website images, videos, etc. Just include your assets as shown in the custom integration example by replacing the origin URL of your static assets with your Zone URL or Zone Alias.

Therefore your URLs will change from looking like this:

<img src="http://yourwebsite.com/img/img.jpg" alt="example image">

To this:

<img src="http://example-hexid.kxcdn.com/img/img.jpg" alt="example image">

The use of custom domains is possible with all options. Just create a Zone Alias (e.g. www.yourwebsite.com) and configure the according CNAME in your DNS provider's dashboard.

How a GitHub CDN integration helps improve page load speed

With a GitHub CDN integration, you will have more control over the performance settings of the edge servers which deliver your GitHub project. Having the ability to modify the expires header from just 10 minutes to up to 1 year provides a large performance enhancement for static files. KeyCDN also offers the additional benefits for GitHub CDN integrations such as:

  • HTTP/2 supported edge servers
  • Let's Encrypt support to enable SSL with a custom Zone URL for free
  • Growing network of POPs
  • Secure Token and Origin Shield

With these improvements, your GitHub CDN integration will help boost the delivery speed of your assets and provide visitors with a better user experience.

Supercharge your content delivery 🚀

Try KeyCDN with a free 14 day trial, no credit card required.

Get started
KeyCDN uses cookies to make its website easier to use. Learn more