In short
- The site is static, hosted on Cloudflare Pages. One CNAME record in Route 53 points the subdomain at it.
- A Pages Functions middleware does what Adobe's Cloudflare Worker does. It sends AI agents to Adobe's edge service and everyone else to the normal page.
- The same middleware counts AI-agent visits in a small Cloudflare D1 database, because ABV gets no CDN logs from this setup.
- Adobe does not document this route. Its one-click Cloudflare setup won't detect it, so verify with a test request.
The setup
abv-demo.wearebarbarian.com
└─ CNAME (in AWS Route 53) ─▶ <project>.pages.dev
└─ functions/_middleware.js
├─ AI agent, HTML page ─▶ live.edgeoptimize.net (Adobe)
│ └─ on any error: normal page
├─ every agent visit ─▶ counted in D1
└─ everyone else ─▶ normal static page
Nothing else on the main domain changes.
Step by step
- Create the Pages project. Connect the GitHub repository in the Cloudflare dashboard, or deploy with
wrangler pages deploy dist. The build command isnpm run buildand the output folder isdist. - Add the custom domain in the Pages project:
abv-demo.wearebarbarian.com. Cloudflare shows the CNAME target. - Add the CNAME in Route 53. Set
abv-demoto<project>.pages.dev. Cloudflare issues the certificate once it sees the record. - Create the D1 database for the agent counter, apply
schema.sql, and bind it to the project asDB. - Turn off AI-bot blocking for the project, including “Block AI bots” and Bot Fight Mode, so AI agents reach the site.
- After ABV onboarding, copy the Optimize at Edge API key from Brands Management and add it as an encrypted Pages variable,
EDGE_OPTIMIZE_API_KEY. SetEDGE_OPTIMIZE_TARGET_HOSTtoabv-demo.wearebarbarian.com.
Verify the routing
Adobe’s check works here too:
curl -sI https://abv-demo.wearebarbarian.com/ -H "user-agent: ChatGPT-User"
A routed request returns an x-edgeoptimize-request-id header. A request with a normal browser user agent must not. If you see x-edgeoptimize-fo: 1, Adobe’s service returned an error and the middleware fell back to the normal page.
What you give up
- One-click setup. ABV’s “Connect with Cloudflare” flow expects a zone it can attach a Worker to.
- CDN logs in ABV. Agentic Traffic and Referral Traffic stay empty unless Adobe accepts logs through its manual route.
- Adobe support. This setup isn’t in Adobe’s guides. Tell your Adobe contact you’re running it before relying on it.
Why the Last-Modified header matters here
Cloudflare Pages does not add a Last-Modified header to static pages. Optimize at Edge skips pages without one. This site writes the header at build time into the _headers file, using each page’s own “updated” date.
Questions
Why not move the whole domain to Cloudflare?
The main domain serves the company's live site and email. Moving its DNS for a demo is a large change with real risk, and it needs sign-off from whoever owns that DNS.
Why not use a Cloudflare Worker route?
Worker routes need the domain's DNS on Cloudflare. Pages custom domains do not, so a Pages Functions middleware is the part of Cloudflare that can run on a subdomain pointed in from elsewhere.
Is the middleware the same as Adobe's Worker?
It follows Adobe's published sample, licensed Apache 2.0, closely. It uses the same agent list, HTML-only matching, headers, loop protection and failover. The difference is failover, which hands the request to the static site instead of fetching the origin again.
Does ABV's Agentic Traffic dashboard work?
Not with this setup. Cloudflare Logpush runs per zone, and the zone isn't on Cloudflare. Our own counter on the Results page stands in. Adobe's manual "Other" log route may be an option; ask Adobe.
Sources
Checked against Adobe's documentation on 4 December 2026. ABV changes often, so check the source before you rely on a detail.