Blog
Markdown for Agents: Accept Headers as a Public API
· 5 min read
HTML is verbose. For an agent summarizing a portfolio, the DOM noise dominates the signal. Cloudflare's Markdown for Agents proposal formalizes what many crawlers already want: ask politely, receive structured text.
Implementation sketch
Middleware inspects Accept. When text/markdown wins quality negotiation, return a purpose-built markdown document with YAML frontmatter and optional JSON-LD — not HTML converted on the fly unless you have edge conversion.
Set Vary: Accept so CDNs do not serve HTML to markdown clients from cache.
Trade-off
You maintain two representations or a generator from structured data. I chose generators tied to caseStudies and siteConfig so markdown never drifts from the React UI.