devlog notes on backend & infra

Static assets and cache headers

· http performance

There are really only two kinds of static file: the ones whose contents are pinned by their name, and the ones that are not. The first kind can be cached effectively forever. The second kind cannot be cached at all without pain.

Once we started hashing filenames at build time, the caching policy stopped being a judgement call and became a lookup. Hashed name means immutable and a year of max-age. Everything else revalidates.

The part that took longest was not the configuration. It was finding every place that referenced an asset by a hardcoded path.

← all posts