Cloudflare Workers for headless Shopify, close to every market.
When does a headless storefront need Cloudflare?
- Shoppers in distant markets wait on a storefront served from one region.
- Market and language routing lives in browser scripts that flash or misfire.
- A/B tests run in the browser and shift the page as it loads.
- Product media is heavy, uncached or resized again on every request.
- You want the storefront itself on Workers, beside your other Cloudflare services.
How do we build an edge layer?
- 01Map the trafficMarkets, routes, cache rules and tests, from your analytics and logs.
- 02Design the edgeWhat runs in Workers, what is cached, and what never is.
- 03Build in slicesRouting first, then caching and media, then tests, each behind a switch.
- 04MeasureReal-user performance and logs compared before and after each change.
- 05Hand overEvery rule in code and documented, run by your team or ours.
Edge logic in code, close to every market.
- Workers for routing, market detection and redirects
- Edge caching keyed by market, currency and language
- Cache purges tied to catalog changes in Shopify
- A/B tests assigned at the edge, without flicker
- Media resized and cached close to each market
- Where chosen, the storefront itself deployed on Workers
- Every rule in code, versioned and documented
What usually goes wrong.
- Caching pages that hold personal data. Carts, accounts and checkout always bypass the cache.
- Forcing shoppers into a market by location. We suggest a market; every market stays reachable.
- Edge logic nobody can find later. Every rule lives in the repository, with tests.
- Assuming every Next.js feature runs on Workers. The adapter is checked against what the build uses.
Every engagement starts with the Readiness Assessment.
A fixed fee, and a better theme, a hybrid and headless compared with a two-year cost for each.
Request a Readiness Assessment- A better theme, a hybrid and headless compared
- A two-year cost for each option
- A recommendation, including when not to go headless
What teams ask about Cloudflare and Shopify.
Can Cloudflare sit in front of our Shopify theme?
This work is for headless storefronts, where you control the hosting. A Liquid theme is hosted and cached by Shopify, so for a theme we improve speed inside the theme instead. The Readiness Assessment tells you which you need.
Does the storefront have to run on Cloudflare?
No. Workers can sit in front of a headless storefront hosted elsewhere and handle routing, tests and caching. Or the storefront can run on Workers outright: Hydrogen, or Next.js through the OpenNext adapter. Your team and stack decide which.
Will edge caching show shoppers stale prices?
It shouldn’t. Catalog pages and media are cached with keys that include market and currency, and purged when products change in Shopify. Carts, accounts and checkout are never cached, and checkout stays on Shopify.
Does geolocation redirect shoppers automatically?
We suggest the right market rather than force it. The Worker reads the visitor’s country, the storefront asks Shopify for that market’s prices and language, and shoppers can still choose another. Crawlers can reach every market.
How do A/B tests at the edge affect SEO?
Each shopper is assigned a variant at the edge and keeps it, so nobody sees one version flash into another. Variants point search engines to a single canonical page, and each test ends with the losing variant removed.
Next steps
Related programs- Start hereReadiness AssessmentA fixed fee, and a better theme, a hybrid and headless compared with a two-year cost for each.
- Headless commerceHydrogen and OxygenWe design and build headless storefronts with Hydrogen, Shopify’s React framework, hosted on Oxygen, the hosting included with paid…
- Headless commerceNext.js storefronts for ShopifyWe build headless Shopify storefronts on Next.js with Shopify’s Hydrogen library, deployed on Vercel, with Sanity for content and…
Start here
Find out what belongs at the edge.
Start with a fixed-fee Readiness Assessment: what runs in Workers, what stays with your host, and what each option costs to own over two years.