Data & Payload Slimming

HTTP Content Negotiation

Direct Definition

HTTP content negotiation is the mechanism by which a client and server agree on the best representation of a resource. Clients send headers such as Accept, Accept-Language, and Accept-Encoding, and the server responds with a matching format, language, or compression.

Technical Architecture & Deep-Dive

A single URL can serve JSON or XML, English or German, gzip or Brotli. The server inspects request headers and returns the most suitable variant, indicating the choice with Content-Type, Content-Language, and Content-Encoding.

Caches must account for negotiation using the Vary header, otherwise a Brotli response might be served to a client that cannot decode it. Edge platforms handle encoding negotiation automatically.

Key Architectural Benefits

Serves the best format and encoding for each client.
Enables localization from a single endpoint.
Supports efficient compression where available.
REALCOMPOSER EDGE WORKSPACE

Implement HTTP Content Negotiation at the Edge

Deploy lightweight API aggregation, edge caching, and secret injection in minutes without Docker containers or complex servers.

START BUILDING FREE

Frequently Asked Questions

Q:What does the Vary header do?

Vary tells caches which request headers affect the response, so they store separate variants, for example per Accept-Encoding value.