Menu

Serving Markdown twins to AI agents from an Astro site on Cloudflare Workers
📰

Serving Markdown twins to AI agents from an Astro site on Cloudflare Workers

DEV Community: astro·Alex·7 days ago
#EyHB3xqu
#devtoastro#devto#dev#html#markdown
Long article (907 words) — no AI summary yet.
Reading 0:00
15s threshold

Most agent traffic to a content site still arrives as an HTML crawl. That works, but it is wasteful: the agent downloads navigation, cookie banners, inline scripts, and tracking tags, then throws most of it away before it can read the article.

llms.txt helps an agent find the right page. It does not help it read that page cheaply. So we added a second representation: every prerendered page gets a Markdown twin, and the edge negotiates between HTML and Markdown with a normal Accept header.

This is how it works on a production Astro site running on Cloudflare Workers, including the parts that broke on the first attempt.

The shape of the idea

For every page /roofing-answering-service/ there is also /roofing-answering-service.md . The HTML page advertises the twin with a Link: rel="alternate" header. An agent that asks for Accept: text/markdown gets the twin directly.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.