Aggressive caching for a Mastodon reverse proxy: what to cache, what to never cache, and why content negotiation will eventually betray you

329 · Stefano Marinelli · June 5, 2026, 7:06 a.m.
Summary
This blog post discusses advanced caching strategies for a Mastodon reverse proxy, targeting the complexities of content negotiation across different request types. The author shares practical configuration details for nginx to optimize performance and prevent errors, highlighting the importance of handling various content types and caching parameters. It emphasizes the need to avoid cache collisions due to varied response types for the same URL and provides insights gained from real-world usage with Mastodon, making it a valuable read for developers managing similar setups.