TL;DR
Support for the Vary header in HTTP has been implemented, addressing issues with content negotiation between different user agents. This enhancement allows for proper caching behind Cloudflare, preventing incorrect content delivery.
✦ Why It Matters
Implement the Vary header in your HTTP responses to ensure correct content delivery based on user agent preferences.
Key Takeaways
Full Summary
Content negotiation in HTTP allows servers to serve different content types based on the 'Accept' header sent by user agents, such as browsers. Previously, deploying this feature behind Cloudflare was problematic because it ignored the Vary header for non-image content, risking the delivery of the wrong format (e.g., JSON instead of HTML).
The recent update enables proper handling of the Vary header, ensuring that user agents receive the expected content type. The author also shares a personal preference for using URL suffixes, like .json, to clearly differentiate between content types.
This approach simplifies the caching strategy and avoids potential content delivery issues. The implications of this update are significant for developers relying on accurate content negotiation in their applications.
Related