Hugo and IPFS: how this blog works (and scales to serve 5,000% spikes instantly!)

Since mid-February 2019, this blog has been served through IPFS and the Cloudflare Distributed Web Gateway. On Wednesday, March 13, 2019, traffic was 5,060% higher than on the same day a week earlier. In a single day, With Blue Ink got almost double the page views than in an typical month before that. Despite the significant increase on traffic, here’s what happened to the CPU usage of one of the main IPFS nodes serving the website: nothing changed. The Hacker News + Reddit effect that wasn’t there a month ago.

With Blue Ink is a static website. I write the content in a bunch of Markdown files, and then generate the HTML pages using Hugo. The entire website (content, theme, scripts) is open source and it’s published on GitHub at ItalyPaleAle/WithBlueInk. When I started this blog in three years ago, I had originally chosen Jekyll, another popular static site generator. Migrating to Hugo brought some other great benefits. Hugo is a small app written in Go, and it’s much, much faster than Jemyll, which is a Ruby gem.

IPFS is a content distribution protocol, not a storage service. It’s more akin to a CDN than a NAS. Distributing files through IPFS can be very fast and very resilient. Thanks to being distributed and peer-to-peer, the IPFS network is resistant to censorship and DDoS attacks. All documents on IPFS are addressed by the hash of their content. They’re also tamper-proof: if someone were to change a single bit in a file, the whole hash would change, and so the address would be different.

IPFS is an open-source protocol for serving web apps. Cloudflare offers a free service that lets edge nodes act as IPFS gateways. I’ve been using IPFS for six months, and this blog for over a month. Here I share my experiences and tips on how to use IPFS in your own web app or blog. If you’re curious to try IPFS, the ipfs (browser extensions) for Firefox and Chrome lets you browse the IPFS network easily.

IPFSauto5

Hugo and IPFS: how this blog works (and scales to serve 5,000% spikes instantly!)