We've reduced our total page size by ~98% and load time by ~35%. To accomplish this, we now cache all static, public assets for up to 1 year. Assets are also cached by our globally-distributed CDN, meaning assets will always be served from a location near you.
We content-address all of our static assets. This is a method of naming the asset based on its content, typically using a hash function. Content-addressing ensures immutability by guaranteeing that the asset's name changes whenever its content does. For example, instead of loading doppler-logo.png, we load something like doppler-logo-a24a706d.png.
This funky naming enables us to crank caching up to the max. We specify a cache policy of public, max-age=31536000, immutable, must-revalidate. Let's break down what this means: