Content Deep Dive
Vary for Images: Serve the Correct Images to the Correct Browsers
Blog post from Cloudflare
Post Details
Company
Date Published
Author
Alex Krivit
Word Count
1,396
Language
English
Hacker News Points
4
Summary
Cloudflare has announced support for Vary, an HTTP header that allows different content types to be served to user-agents with varying capabilities. This is particularly useful in serving optimized image formats to browsers with differing capabilities. The Vary header enables origins to serve variants of the same content from a single URL and have intermediate caches deliver the correct variant to each user-agent that comes along. By parsing the request's Accept header, Cloudflare ensures that the origin knows exactly what content it needs to deliver to the browser. This feature is currently available for Pro, Business, and Enterprise Customers through the Cloudflare API.