s
Nov. 20, 2023, 5:08 a.m. |

Simon Willison's Weblog simonwillison.net

Cloudflare does not consider vary values in caching decisions


Here's the spot in Cloudflare's documentation where they hide a crucially important detail:

"Cloudflare does not consider vary values in caching decisions. Nevertheless, vary values are respected when Vary for images is configured and when the vary header is vary: accept-encoding."

This means you can't deploy an application that uses content negotiation via the Accept header behind the Cloudflare CDN - for example serving JSON or HTML for the same URL …

caching cloudflare decisions documentation encoding hide http images spot values

Data Engineer

@ Cepal Hellas Financial Services S.A. | Athens, Sterea Ellada, Greece

Senior Manager Data Engineering

@ Publicis Groupe | Bengaluru, India

Senior Data Modeler

@ Sanofi | Hyderabad

VP, Product Management - Data, AI & ML

@ Datasite | USA - MN - Minneapolis

Supervisão de Business Intelligence (BI)

@ Publicis Groupe | São Paulo, Brazil

Data Manager Advertising (f|m|d) (80-100%) - Zurich - Hybrid Work

@ SMG Swiss Marketplace Group | Zürich, Switzerland