Aggressive caching for a Mastodon reverse proxy: what to cache, what to never cache, and why content negotiation will eventually betray you
Mastodon serves HTML, ActivityPub JSON, and API JSON on the same URLs, so caching by URL alone causes content-type mismatches. The article details an nginx proxy configuration using Accept-header variant maps in cache keys, separate location blocks with tailored TTLs, and explicit bypass rules for authenticated or actor-dependent requests.