Edge SEO with Cloudflare Workers: a practitioner's notes
A practical field guide for SEOs who like rolling their own infrastructure.
Meera Iyer
Principal Engineer
Why edge SEO at all
Most enterprise SEO programs hit the same wall. The fix is obvious, the dev team is booked through next quarter, and the patch you actually need is fifteen lines of code. Workers let you ship that patch this afternoon, sit it in front of the origin, and roll back without a deploy.
Where Workers earn their keep
- Injecting hreflang clusters on legacy templates the CMS cannot touch.
- Rewriting canonical tags on parameterised URLs that print fifty variants of the same page.
- Serving an updated robots.txt without waiting on a deploy window.
- Adding structured data to product pages while the platform team finishes their refactor.
- Stripping bloated third party scripts from crawl requests so Lighthouse stops crying.
Where they will hurt you
Anything that touches authentication, anything that mutates checkout, and anything that rewrites prices. Workers are stateless and globally distributed. A bug ships to every region in seconds. We treat any change that touches commerce flows as off limits and route those through the normal deploy pipeline.
We also avoid using Workers as a long term home for fixes. Every patch lands in a tracker with an expiry date. If the underlying issue is not fixed at origin within a quarter, we escalate.
Our deployment ritual
Every Worker change goes through three gates. A staging route on a non production hostname. A canary against five percent of traffic for at least an hour. A diff of pre and post crawl logs from our own bot. If any of the three look off, we revert.
Edge code is leverage. Leverage without a rollback button is just a faster way to break things.
Work with us
Want this kind of thinking on your next quarter?
We take on a small number of new engagements each quarter. If the brief is interesting, we will say so. If it is not, we will tell you that too.
Start a conversation