Agent Ready HTML

How to serve markdown on request on each host

In short

Generate a markdown twin for every page at build time, then answer requests that send Accept: text/markdown with the twin, the right content type and Vary: Accept. Each host has its own switch: a Cloudflare setting, a Vercel rewrite, a Framer default, a Webflow Enterprise option, a WordPress plugin.

Agents ask for markdown on about 65 percent of fetches in the Vercel and Ora data. A site can answer them with a twin file and one rule. This site does exactly that, and the code below is the whole of it.

What the evidence says

  • Cloudflare: toggle Markdown for Agents in Quick Actions on a Pro, Business or Enterprise zone. [primary source] source, read 4 November 2026.
  • Vercel and Next.js: a rewrite in next.config.ts that detects the Accept header and a route handler that returns markdown. [primary source] source, read 4 November 2026.
  • Framer: on by default for every page; Webflow: an Enterprise site setting since 2026-04-02. [primary source, 2026-04-02] source, read 4 November 2026.
  • WordPress: the Markdown Alternate plugin adds .md endpoints, a link rel alternate tag and Accept-header negotiation. [primary source] source, read 4 November 2026.
  • Responses should carry Content-Type: text/markdown; charset=utf-8 and Vary: Accept. [primary source] source, read 4 November 2026.
  • Cloudflare serves /index.md twins for agents that do not send the header, using a request header transform rule and a URL rewrite. [primary source] source, read 4 November 2026.

Steps

  1. Produce a markdown file for every page at build time, next to the page: /path/index.md for /path/.
  2. Add one rule at the edge: when the request carries Accept: text/markdown and the path is a page, answer with the twin.
  3. Set Content-Type: text/markdown; charset=utf-8 and Vary: Accept on the response so a cache keeps the two forms apart.
  4. Add a link element with rel="alternate" and type="text/markdown" to every page so agents that do not send the header can still find the twin.
  5. Use the host's own switch where there is one instead of writing the rule: Cloudflare, Framer and Webflow are listed below, and a WordPress plugin covers WordPress.
  6. Test with curl and read the content type.

The rule on Netlify (an edge function, TypeScript)

export default async (request: Request, context: Context) => {
  const accept = request.headers.get('accept') || '';
  const url = new URL(request.url);
  if (!/\btext\/markdown\b/.test(accept) || url.pathname.includes('.')) {
    const res = await context.next();
    res.headers.set('vary', 'Accept');
    return res;
  }
  const twin = new URL(url.pathname.replace(/\/?$/, '/') + 'index.md', url);
  const res = await context.rewrite(twin);
  const headers = new Headers(res.headers);
  headers.set('content-type', 'text/markdown; charset=utf-8');
  headers.set('vary', 'Accept');
  return new Response(res.body, { status: res.status, headers });
};

Test

curl -sI -H 'Accept: text/markdown' https://example.com/ | grep -i -E '^(content-type|vary)'

Check the result

The viewer flag "Markdown on request" turns found when the response has a text/markdown content type; it notes a missing Vary: Accept. Open the viewer to run it on your own URL.

Related: all guides, initial HTML, llms.txt.

Sources

  1. Cloudflare: Introducing Markdown for Agents https://blog.cloudflare.com/markdown-for-agents/, read 4 November 2026
  2. Vercel: Making agent-friendly pages with content negotiation https://vercel.com/blog/making-agent-friendly-pages-with-content-negotiation, read 4 November 2026
  3. Webflow update: Markdown for AI agents https://webflow.com/updates/markdown-for-agents, read 4 November 2026
  4. Joost de Valk: Markdown Alternate https://joost.blog/markdown-alternate/, read 4 November 2026
  5. Vercel and Ora: Make your site readable by AI agents https://vercel.com/kb/guide/make-your-site-readable-by-ai-agents, read 4 November 2026
  6. Cloudflare: agent readiness score and Radar numbers https://blog.cloudflare.com/agent-readiness/, read 4 November 2026

Last reviewed 4 November 2026