Learn how to configure HTTP content negotiation so requests with Accept: text/markdown receive a clean, token-efficient Markdown document while human browser visitors receive standard HTML.
1. The Negotiation Flow
When an AI agent (such as Claude, Perplexity, or GPTBot) requests a web page with Accept: text/markdown, edge middleware rewrites the internal request to a markdown synthesizer:
- Header Inspection: Check for
Accept: text/markdown. - AST Transformation: Extract semantic article body, headings, and code blocks while stripping layout navigation.
- Response Headers: Serve with
Content-Type: text/markdown; charset=utf-8andVary: Accept.
