Cloudflare edge Worker
Cloudflare settings
Three groups of settings outside the Worker decide whether it works: features that rewrite your HTML, bot and firewall rules that run before it, and your origin's view of Cloudflare's traffic.
Turn off features that rewrite your HTML#
A proxied hostname gets some Cloudflare HTML rewriting by default, independent of the Worker. On our own test site, Email Address Obfuscation replaced the footer email address with a placeholder and a decoder script: visitors saw a change, and AI crawlers lost the address. For the routed hostnames:
- Email Address Obfuscation: off. Under Scrape Shield (Security → Settings in newer dashboards). To limit it to the routed hostnames, use a Configuration Rule instead of the zone setting.
- Rocket Loader: off. Speed → Optimization → Content Optimization. It rewrites
<script>tags. - Auto Minify: off, where your plan still shows it.
- Web Analytics automatic setup: off, unless you use it on purpose. With it on, Cloudflare adds a
static.cloudflareinsights.combeacon script to every HTML response a browser receives. Aiptimise does not need it. - Review anything else under Speed → Optimization that changes HTML: Mirage, Zaraz automatic injection, Automatic Platform Optimization.
Let AI crawlers through#
Cloudflare's bot and firewall features run before Workers. A crawler blocked there never reaches the Worker, so it never sees the structured data. On one site we checked, GPTBot, OAI-SearchBot and PerplexityBot got 403 from Cloudflare while ClaudeBot got 200.
- Security → Bots: check Block AI Scrapers and Crawlers (AI Crawl Control in newer dashboards). If it is on, allow at least the search and assistant crawlers you want to be found by:
OAI-SearchBot,ChatGPT-User,PerplexityBot,Perplexity-User,Claude-SearchBot,Claude-User,Googlebot,Bingbot. - Bot Fight Mode / Super Bot Fight Mode: "Definitely automated" set to Block or Managed Challenge can catch crawlers. Verified bots are usually allowed, but not every AI crawler is on Cloudflare's verified list.
- WAF custom rules and rate limiting: look for rules that challenge or block by user agent, by ASN (crawlers come from cloud providers) or by country.
- Your robots.txt is separate: the Worker does not change it.
Let Cloudflare reach your origin#
With the Worker in front, all traffic reaches your origin from Cloudflare's IP ranges. Origin-side DDoS protection can read that as one very busy client and start challenging it, and visitors then get a challenge page instead of your site.
- If your origin or its firewall allow-lists or rate-limits by IP, allow Cloudflare's IP ranges (IPv4 and IPv6), and read the visitor's IP from
CF-Connecting-IP. - Origin on Vercel: we have seen Vercel's automatic DDoS mitigation answer Worker traffic with
403 Vercel Security Checkpointpartway through a load test, with Bot Protection and Attack Mode both off. In the Vercel project, Firewall → System Bypass Rules, add a rule per Cloudflare range scoped to your production domain. A rule accepts at most a /16, so split larger ranges:104.16.0.0/13becomes the eight /16s from104.16.0.0/16to104.23.0.0/16. - Other hosts and firewalls (AWS WAF, Fastly, nginx
limit_req, …): the same idea. Exempt Cloudflare's ranges from IP-based limits.