§ LLMS.FREELLMS.TXT STUDIOVERIFIED 2026

llms.txt Cloudflare Workers and Pages Setup Guide

Cloudflare Workers and Pages can serve /llms.txt directly from the edge with sub-20ms global latency. Whether you upload a static file with custom _headers or return Markdown from a Worker fetch handler, proper UTF-8 and Cache-Control headers ensure AI tools always read a fresh copy.

§ 01 · EDGE DELIVERYWORKERS + PAGES _HEADERSCLOUDFLARE

Serve llms.txt From Cloudflare Workers or Pages

For static sites on Cloudflare Pages or Workers Static Assets, generate your file in the llms.txt Studio, drop it in public/llms.txt and pair it with a _headers rule. For dynamic sites backed by KV or D1, return it from your Worker fetch() handler with an explicit edge cache header.

const LLMS_TXT = `# My Cloudflare Site

> Fast edge APIs and developer documentation.

## Documentation
- [Getting Started](https://example.com/docs): Setup and authentication
- [API Reference](https://example.com/api): Endpoints and rate limits
`;

export default {
  async fetch(request: Request): Promise<Response> {
    const url = new URL(request.url);
    if (url.pathname === '/llms.txt') {
      return new Response(LLMS_TXT, {
        headers: {
          'Content-Type': 'text/plain; charset=utf-8',
          'Cache-Control': 'public, max-age=3600, s-maxage=86400',
        },
      });
    }
    return new Response('Not Found', { status: 404 });
  },
};
§ 02 · BOT ACCESSWAF AND BOT FIGHT MODEDELIVERY CHECKS

Check Cloudflare Bot and WAF Rules

  • Test with plain curl -I https://yourdomain.com/llms.txt — confirm you receive HTTP 200 and content-type: text/plain; charset=utf-8 rather than a JavaScript challenge page.
  • Exempt /llms.txt in custom WAF rules — if you challenge non-browser user agents site-wide, add a skip rule for exact path /llms.txt so coding assistants can fetch it cleanly.
  • Keep cache TTL reasonable — max-age=3600 (1 hour) balances edge speed with fast updates after documentation releases.
§ FAQCOMMON QUESTIONSANSWERS

Cloudflare llms.txt Questions

Does Cloudflare Automatically Serve public/llms.txt With UTF-8?

Cloudflare serves .txt files as text/plain, but adding an explicit _headers rule guarantees charset=utf-8 and your preferred Cache-Control duration across all edge PoPs.

Can I Pair Cloudflare Workers AI With llms.txt?

Yes. Many teams serve a static /llms.txt index on Workers Static Assets while calling Cloudflare Workers AI (10,000 free daily Neurons) for docs Q&A or summarization.