Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Fastly CDN

Within the CDN, we run a Fastly Compute WASM module. The code lives in our simpleinfra repository.

This enables us to move performance-critical logic to the edge and write integration tests for it.

The Compute module uses Fastly NgWAF to block malicious requests at the CDN before they reach our origin servers.

The Fastly service is configured via Terraform in the same repository.

The Cache-Control headers returned by our web server determine which content is cached. There should not be any cache rules in the CDN module. For now, we also don’t want any business logic in the CDN, which makes the web server easier to test and manage.

We also use the Fastly origin shield to reduce the load on our web servers and improve cache ratios.

Changes and Deployment

We typically make changes in the simpleinfra repository, after which they are reviewed and manually applied by the infrastructure team.