Proxy mode is Legible's preferred deployment path when you can control the edge. It lets the same page URL serve HTML to browsers and Markdown to AI crawlers depending on the request headers.
This gives you the cleanest AI delivery model: human visitors keep their normal experience while AI systems receive structured, lightweight content from the same canonical URL.
What Proxy Mode Means
In proxy mode, Legible sits at the request layer in front of your origin or beside it through a Cloudflare Worker or equivalent proxy. The proxy examines the request, decides whether the caller wants HTML or Markdown, and returns the correct representation.
That is different from proxy-free mode, where HTML stays on the main site and Markdown is served from a separate URL such as `read.yourdomain.com`.
Why Cloudflare Is The Preferred Path
- Same-URL `Accept: text/markdown` delivery.
- Response headers such as `Content-Signal`, `Vary: Accept`, and cache directives can be attached directly at the edge.
- Fast edge caching keeps AI fetches efficient and consistent.
- No need to add discovery tags to every page template if same-URL negotiation is in place.
Basic Setup Flow
- Point the site to Cloudflare DNS if it is not already there.
- Enable the site in Legible and choose proxy mode.
- Connect the domain or zone details Legible needs for Worker-based routing.
- Make sure the relevant hostname is proxied through Cloudflare, not DNS-only, if the setup requires Worker interception.
- Run Legible's verification checks and confirm AI endpoints respond correctly.
Understanding `Vary: Accept`
The `Accept` header tells the server what representation the client prefers. Browsers typically want `text/html`, while AI clients or crawlers may request `text/markdown` or another machine-readable format.
The `Vary: Accept` header tells caches that the response may change based on that header. Without it, a cache could incorrectly serve Markdown to a browser or HTML to an AI crawler.
GET /blog/post HTTP/1.1
Host: example.com
Accept: text/markdown
HTTP/1.1 200 OK
Content-Type: text/markdown; charset=utf-8
Vary: AcceptHeaders You Will See In Proxy Mode
- `Content-Type` indicates whether the response is HTML, Markdown, JSON, or plain text.
- `Vary: Accept` protects content negotiation in caches.
- `Content-Signal` communicates AI usage permissions at the response layer.
- `Cache-Control` shapes how long crawlers and edge caches can reuse content.
- `X-Powered-By` or diagnostic headers can help confirm Legible is handling the request.
Cloudflare Terminology That Matters
- DNS-only means Cloudflare resolves the record but does not proxy the traffic through its edge.
- Proxied means Cloudflare sits in front of the request and can run Workers, rules, and caching behavior.
- A Worker is Cloudflare's programmable request/response layer and is what enables same-URL negotiation for Legible.
- Cache rules determine how HTML, Markdown, and AI-specific endpoints are cached.
Troubleshooting Proxy Mode
- If browsers are seeing Markdown, check `Accept` handling and cache separation.
- If AI fetches are still receiving HTML, verify the Worker or proxy rule is active on the correct hostname and path.
- If Cloudflare shows the record as DNS-only, the Worker cannot intercept requests there.
- If stale content is being served, review edge cache headers and Legible sync timing.
