A growing share of my side project's traffic isn't people. Forgemage is a marketplace where Dofus players find smithmages, and since AI-assisted search took off, some of its "visitors" are LLMs fetching a page to answer somebody's question. They get what browsers get: 59 KB of HTML for roughly a thousand words of actual content. The rest is Bootstrap classes, SVG icons, a cookie banner, and a footer the agent will dutifully tokenize and ignore.
In February, Cloudflare shipped a feature called Markdown for Agents: when a client sends Accept: text/markdown, their edge converts the HTML response to markdown on the fly. They claim about 80% fewer tokens per page. It's a dashboard toggle — on Pro plans and up.
The thing is, there's no Cloudflare magic in that contract. It's HTTP content negotiation, a mechanism older than most of the web's problems, plus an HTML-to-markdown converter. Forgemage is a Symfony app, so I implemented the same behavior myself: one event subscriber, one composer package, an afternoon including tests. This post walks through the implementation and the three details that would have bitten me in production if the RFC hadn't warned me first.
The contract before the code






