
Two Next.js rewrites that serve Markdown to agents without breaking the cache
Serve Markdown for Accept: text/markdown in Next.js by placing a beforeFiles rewrite on static pages and a fallback rewrite on unmatched paths in next.config.ts, pointing at force-static route handlers that send Vary: Accept. Unlike proxy.ts or headers() in page.tsx, the HTML cache key and Next's router Vary header stay untouched.

