🤖 AI Summary
Developer skeptrune announced an approach to make websites “agent-friendly” by returning plain Markdown instead of full HTML when an LLM (or any client) sends an Accept header that prefers text/markdown or text/plain ahead of text/html. The change cuts the amount of text tokens an agent must ingest—Bun reported a ~10x token reduction for Markdown—so it reduces cost for pay-per-token models, improves scraping efficiency, and increases the chance content is used by assistants and training pipelines (what the author calls GEO: Generative Engine Optimization). You can test it with curl -H "Accept: text/markdown" against the site.
Technically, the implementation converts build output HTML to Markdown (using @wcj/html-to-markdown-cli), runs that as a post-build step, and serves the right asset based on Accept-order logic. The provided Cloudflare Worker inspects the Accept header (comparing indices of text/plain or text/markdown vs text/html), maps requests to /markdown/.../index.md or /html/.../index.html, serves sitemap.xml for root if requested, and falls back between formats. The writeup also includes an easier Caddy configuration alternative for traditional reverse proxies. The result: lower token bills, faster agent consumption, and better discoverability for sites that expect LLM-driven traffic.
Loading comments...
login to comment
loading comments...
no comments yet