Get the latest tech news
Use the Accept Header to Serve Markdown Instead of HTML to LLMs
Make your website accessible to LLM agents by serving plain Markdown when they request text/plain or text/markdown. Save tokens and improve agent experience with this simple Astro and Cloudflare Workers implementation.
I decided to make my Astro sites more accessible to LLMs by having them return Markdown versions of pages when the Accept header has text/plain or text/markdown preceding text/html. Below is a minimal worker script that inspects the Accept header and serves markdown when requested, otherwise falls back to HTML: By serving lean, semantic Markdown to LLM agents, you can achieve a 10x reduction in token usage while making your content more accessible and efficient for the AI systems that increasingly browse the web.
Or read this on Hacker News