Skip to content

CONCEPT Cited by 2 sources

Markdown content negotiation

Definition

Markdown content negotiation is the convention that when a client sends Accept: text/markdown on an HTTP request, the server responds with a clean markdown representation of the same URL instead of HTML. It's standard HTTP content negotiation per RFC 9110 applied to a new MIME type (text/markdown).

Why it matters for agents

HTML wastes tokens: navigation chrome, <div> soup, inline styles, hydration markers, ads, cookie banners, analytics scripts, related-articles widgets — none of that is content for an LLM. Markdown is ~what the LLM was trained on; {heading, paragraph, list-item, link, code-block} is all it needs.

Measured on Cloudflare's own docs (2026-04-17):

"The markdown version requires far fewer tokens — we measured up to 80 % token reduction in some cases — which makes responses faster, cheaper, and more likely to be consumed in its entirety, given the limits on context windows that most agent tools have by default."

At scale, 80 % fewer tokens per doc-fetch is 5× more calls per context window, 5× fewer dollars per agent-turn, and 5× better odds of fitting the relevant doc in a single read rather than paginating into a grep loop.

Adoption (2026-04)

  • 3.9 % of the top 200 k domains handle markdown content negotiation correctly, per Cloudflare Radar.
  • Only 3 of 7 agents Checkly tested (February 2026) send Accept: text/markdown by default: Claude Code, OpenCode, Cursor. Reference: State of AI Agent Content Negotiation.
  • Second major vendor adoption (2026-04-21): Vercel enabled markdown content negotiation across vercel.com/blog and vercel.com/changelog with a Next.js rewrite-to-markdown-route implementation. Vercel's measurement: ~500 KB HTML → ~3 KB markdown = 99.37 % payload reduction on one blog post. Different measurement axis from Cloudflare's token-count savings (server-side bytes vs client-side tokens), but same load-bearing direction.

These numbers together argue for a URL-based fallback — don't assume the agent will send the header. See patterns/dynamic-index-md-fallback for Cloudflare's Transform-Rules-based /index.md approach, or patterns/link-rel-alternate-markdown-discovery for Vercel's HTML <head>-based advertisement.

Failure modes and caveats

  • Caching surface increases. A CDN now caches per-Accept variant; you need Vary: Accept at minimum or a URL- differentiated path (/index.md).
  • Rendering parity is load-bearing. If the markdown is a stripped-down pre-render, content can diverge from the HTML version over time unless the server renders both from one source of truth.
  • Most agents don't send the header. Until agent defaults change, rely on /index.md-style URL fallbacks (patterns/dynamic-index-md-fallback) and / or hidden HTML directives that tell the LLM about the markdown URL.

Seen in

Vendor-instance comparison

Dimension Cloudflare (2026-04-17) Vercel (2026-04-21)
Implementation locus Edge (Transform Rules) App-server (Next.js rewrites)
Fallback URL scheme /index.md suffix None (header-only primary)
Third-layer discovery Hidden HTML directive <link rel="alternate"> tag
Measured savings 80 % tokens 99.37 % bytes
Measurement scope Aggregate across docs Single representative blog post
Product context Developer docs Blog / changelog
Also exposes llms.txt + per-product splits Markdown sitemaps (hierarchical)

Two independent implementations of the same concept landing within a week (2026-04-17 → 2026-04-21) is a strong adoption signal for the primitive.

Last updated · 542 distilled / 1,571 read