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 Architect

@ University of Texas at Austin | Austin, TX

Data ETL Engineer

@ University of Texas at Austin | Austin, TX

Lead GNSS Data Scientist

@ Lurra Systems | Melbourne

Senior Machine Learning Engineer (MLOps)

@ Promaton | Remote, Europe

Research Scientist

@ Meta | Menlo Park, CA

Principal Data Scientist

@ Mastercard | O'Fallon, Missouri (Main Campus)