Octopress/Jekyll + S3 + CloudFront + gzip

We recently moved this blog from WordPress to Octopress. Static pages FTW! And because we have static pages we want to use every CDN power we can get. We choose to use AWS CloudFront. There are some fine tutorials on the interweb how to make all this work:

Blogging with Jekyll + S3 + CloudFront
Quick Tip for Easily Deploying Octopress Blog on Amazon CloudFront

One open thing was to enable gzipped content. Zipping is certainly the most obvious performance optimization. Usually the webserver takes care of it, but we don’t have a webserver here. We have a CDN and like every CDN CloudFront doesn’t “process” request, it just serves files. Meaning that by definition it does not compress files when requested by a client. However that only means that we need to create zipped files when we deploy the Octopress files. A very good starting point:

gzip your Octopress

I made some modifications regarding CloudFront. Also rename is not available on OSX so I changed it around a bit.

View code on gist.github.com