# Guides

Ship correct content negotiation.

## Fundamentals

- [What content negotiation is](https://acceptmarkdown.com/guides/what-is-content-negotiation) — One URL, many representations. The server picks which bytes to send based on the client's `Accept` header.
- [Why markdown for LLMs](https://acceptmarkdown.com/guides/why-markdown-for-llms) — Fewer tokens, higher retrieval signal, faster responses. The three reasons an agent prefers markdown over the HTML you'd send a browser.
- [The Accept: text/markdown convention](https://acceptmarkdown.com/guides/accept-text-markdown) — What agent clients send, what your server should match on, and the exact media-type string defined by RFC 7763.
- [Cloudflare — Markdown for Agents](https://acceptmarkdown.com/guides/cloudflare-markdown-for-agents) — If your site sits behind Cloudflare, flipping this one toggle negotiates Markdown at the edge with no origin changes required.

## Getting it right

- [Set the Vary: Accept header](https://acceptmarkdown.com/guides/vary-accept) — Without `Vary: Accept`, CDNs and browser caches will happily serve the wrong representation to the wrong audience.
- [Parsing Accept & quality values](https://acceptmarkdown.com/guides/accept-parsing) — Ranking types by q-value, breaking ties by specificity, and respecting `q=0`. The parsing rules every content-negotiating server needs to get right.
- [Returning 406 Not Acceptable](https://acceptmarkdown.com/guides/returning-406) — When an `Accept` header genuinely can't be satisfied, `406` is the right response. The common mistake is returning it too eagerly.
- [Caching & CDN setup](https://acceptmarkdown.com/guides/caching-cdn) — `Vary: Accept` is necessary but not always sufficient. Cloudflare, Fastly, and Vercel each have quirks you need to know before production.

## Generating the Markdown

- [Generating the Markdown](https://acceptmarkdown.com/guides/generating-markdown) — Three approaches — source-of-truth, build-time dual rendering, and runtime HTML-to-Markdown. Pick one based on where your content lives.
