---
title: "Cloudflare Workers: publish your IndexNow key without touching your store"
description: "How to assess routes, serve a key file, and check DNS, key rotation, and recovery with an example Worker."
url: "https://cookingmetrics.com/blog/clave-indexnow-cloudflare-workers/"
markdown_url: "https://cookingmetrics.com/blog/clave-indexnow-cloudflare-workers.md"
lang: "en"
date_published: "2026-08-02"
author: "Martín Garay"
author_url: "https://cookingmetrics.com/about-martin-garay/"
publisher: "CookingMetrics"
publisher_url: "https://cookingmetrics.com/"
keywords: ["IndexNow", "Cloudflare", "Technical SEO"]
citation_apa7: "Garay, M. (2026, August 2). *Cloudflare Workers: publish your IndexNow key without touching your store*. CookingMetrics. https://cookingmetrics.com/blog/clave-indexnow-cloudflare-workers/"
references_apa7:
  - "Cloudflare Docs. (n.d.). *Workers limits*. https://developers.cloudflare.com/workers/platform/limits/"
  - "IndexNow.org. (n.d.). *IndexNow documentation*. https://www.indexnow.org/documentation"
  - "Cloudflare Docs. (n.d.). *Workers routes*. https://developers.cloudflare.com/workers/configuration/routing/routes/"
  - "Cloudflare Docs. (n.d.). *Fetch API in Workers*. https://developers.cloudflare.com/workers/runtime-apis/fetch/"
  - "Cloudflare Docs. (n.d.). *How Cloudflare for SaaS works*. https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/saas-customers/how-it-works/"
---

# Cloudflare Workers: publish your IndexNow key without touching your store

> How to assess routes, serve a key file, and check DNS, key rotation, and recovery with an example Worker.

- **Author:** [Martín Garay](https://cookingmetrics.com/about-martin-garay/) · Founder of CookingMetrics
- **Published:** August 2, 2026
- **Topics:** IndexNow, Cloudflare, Technical SEO
- **Web version:** https://cookingmetrics.com/blog/clave-indexnow-cloudflare-workers/

## How to cite this article (APA, 7th edition)

Garay, M. (2026, August 2). *Cloudflare Workers: publish your IndexNow key without touching your store*. CookingMetrics. https://cookingmetrics.com/blog/clave-indexnow-cloudflare-workers/

In-text citation: (Garay, 2026)

## References

- Cloudflare Docs. (n.d.). *Workers limits*. https://developers.cloudflare.com/workers/platform/limits/
  In-text citation: (Cloudflare Docs, n.d.)
- IndexNow.org. (n.d.). *IndexNow documentation*. https://www.indexnow.org/documentation
  In-text citation: (IndexNow.org, n.d.)
- Cloudflare Docs. (n.d.). *Workers routes*. https://developers.cloudflare.com/workers/configuration/routing/routes/
  In-text citation: (Cloudflare Docs, n.d.)
- Cloudflare Docs. (n.d.). *Fetch API in Workers*. https://developers.cloudflare.com/workers/runtime-apis/fetch/
  In-text citation: (Cloudflare Docs, n.d.)
- Cloudflare Docs. (n.d.). *How Cloudflare for SaaS works*. https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/saas-customers/how-it-works/
  In-text citation: (Cloudflare Docs, n.d.)

---

[IndexNow](https://cookingmetrics.com/blog/que-es-indexnow/) verifies ownership through a file containing the key. It is usually placed at the domain root; the protocol also documents other locations using `keyLocation` with a specific scope. If your platform cannot serve the file, a Worker may be able to respond at that URL, provided the domain configuration allows it. [Official documentation](https://www.indexnow.org/documentation).

## What a Cloudflare Worker is

**Cloudflare** is the network that speeds up and protects a huge part of the internet; if your store uses a custom domain, your DNS very likely goes through it already. A **Worker** is a mini-program that runs on Cloudflare's servers, *before* traffic reaches your store. You can tell it: "when someone requests exactly this URL, answer it yourself; let everything else through".

That turns the impossible problem into a trivial one: the key file doesn't need to exist on your store — **Cloudflare answers it for you**.

## The architecture we use (and why it's key-agnostic)

A good approach is to separate two pieces: how the Worker obtains the key and which route invokes it. Looking up a current key through an API may avoid changing code when it changes, but it does not automatically update a route whose name contains the previous key.

1. **Scoped routes:** configure the exact file for each expected host. A pattern such as `/*.txt` is invalid; a broad `domain/*` route includes all that traffic and needs a separate assessment.
2. **Request filter:** check the file name and response; unrelated paths should keep their expected behavior.
3. **Key source:** it may be a setting in the example or an API from the connector. In the latter case, check its contract, errors, and freshness. An exact route tied to the key must be changed when the key rotates. [Cloudflare route patterns](https://developers.cloudflare.com/workers/configuration/routing/routes/).


[Section for signed-in readers, level C: https://cookingmetrics.com/blog/clave-indexnow-cloudflare-workers/#bloque-1]


Cost depends on plan, volume, and route scope. Review the [current Workers limits](https://developers.cloudflare.com/workers/platform/limits/) and your account's usage. A broad route may invoke the Worker for requests across the store; do not assume zero cost or a particular number of visits.


[Section for signed-in readers, level C: https://cookingmetrics.com/blog/clave-indexnow-cloudflare-workers/#bloque-2]


## The real case that taught us DNS: A records eating your Worker

The historical case that prompted this guide showed a difference: the key responded on `www`, while the apex returned 404. That is a useful symptom to investigate host by host, but it does not show that every A record for a SaaS platform should be replaced.

Before changing DNS, check the values supported by the platform, the proxy, routes, and Cloudflare for SaaS behavior. Cloudflare's [O2O documentation](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/saas-customers/how-it-works/) explains that two zones may be involved. Keep the previous configuration and validate the store and email too; an instant or interruption-free change is not guaranteed. The rest of the setup is in the [technical guide to Cloudflare for SEO and GEO](https://cookingmetrics.com/blog/cloudflare-seo-geo-guia-tecnica/).


[Section for signed-in readers, level C: https://cookingmetrics.com/blog/clave-indexnow-cloudflare-workers/#bloque-3]


## Doing it by hand vs. guided

Everything above can be configured manually in 10-15 minutes if you're comfortable with Cloudflare (and if you're not, start with the [jargon-free setup guide](https://cookingmetrics.com/blog/como-implementar-cloudflare-seo-geo/)). **[IndexNow Connect](https://cookingmetrics.com/product/indexnow-connect/)** turns it into a checklist: the built-in guide uses your real domain and key, shows screenshots of every Cloudflare screen (with the exact buttons), gives you the ready-to-paste snippet, diagnoses live what your domain is responding — including the A-records case — and verifies the key automatically once everything is in place.


[Section for signed-in readers, level C: https://cookingmetrics.com/blog/clave-indexnow-cloudflare-workers/#bloque-4]


## Frequently asked questions

### Does the Worker slow my store down?

With an exact route, the intended scope is limited to the key file. Check the actual patterns and any broader route in the zone. This guide does not present a latency measurement for your store.

### Do I need a paid Cloudflare plan?

You may be able to use a free plan depending on account features and volume. Check current limits and usage; do not assume every domain or pattern has the same cost.

### What happens if my IndexNow key rotates?

Review the file, sender, and routes. If the Worker looks up the current key through an API, you may not need to change its code, but an exact route containing the old name does need an update. Verify the new file before considering the rotation complete.

### Does this work for any SaaS platform?

It depends on the platform, domain control, and Cloudflare configuration. Using Cloudflare for DNS alone does not prove the route will run. Check compatibility and test a sample before changing a real store.

The guide in IndexNow Connect, the [CookingMetrics](https://cookingmetrics.com/) tool for notifying IndexNow of catalog changes, walks through this same Worker with your real domain and key, and verifies the key once it is published. Which platforms it is available for is on the [IndexNow Connect product page](https://cookingmetrics.com/product/indexnow-connect/).

---

## About the author

**[Martín Garay](https://cookingmetrics.com/about-martin-garay/)** — Founder of CookingMetrics

I'm Martín Garay, founder and Martech Advisor at CookingMetrics and Chair of the Technology Committee at CACE, Argentina's ecommerce chamber. For more than 20 years I've worked in Analytics, development, technical SEO and ecommerce: I implement measurement, find where it breaks and turn it into information you can act on.

### My work at CACE, Argentina's ecommerce chamber

- **Chair of the Technology Committee** (SINCE AUGUST 2025): I set the committee's agenda together with Gabriel Topola, vice-chair. We look at the platforms and tools an online business needs to grow: CMS, integrations, customer service and omnichannel operations.
- **Curating the technical forum** (IT CAMP · ECOMMERCE DAY ARGENTINA): With CACE's Events team I put together the IT Camp programme: talks for engineering and development teams on platform architecture, code and good practice, given by speakers who do the implementation work.
- **Marketing and Data Analytics committees** (SINCE 2016): I started in the Marketing committee and helped create the Data Analytics committee. I gave Google Analytics webinars, including the migration to GA4, and worked on the Google Analytics implementation for Hot Sale and Cyber Monday.
- **Ecommerce metrics dashboard** (FOR MEMBERS): With the Data Analytics committee and the CACE Community team we built a dashboard in Google Analytics and Looker Studio so each member can check the key indicators of their own store.

### Talks

- [From SEO to GEO: what it takes for a brand to be cited by an answer engine](https://www.youtube.com/watch?v=mlyjuSBdMzI) — ECOMMERCE DAY ARGENTINA 2026 · IT CAMP · AUGUST 27, 2026 · BUENOS AIRES CONVENTION CENTER
- [SEO for AI: how to prepare a brand to show up in ChatGPT and Google's AI overviews](https://www.youtube.com/watch?v=4dI7jqnLg-M) — AI IN LATAM 2025 · BUENOS AIRES · OVER 3,500 ATTENDEES AND 100 SPEAKERS, PER THE ORGANIZERS

### Profiles and links

- [Full profile](https://cookingmetrics.com/about-martin-garay/)
- [LinkedIn](https://www.linkedin.com/in/seospecialistmartingaray/)
- [Instagram](https://www.instagram.com/garaymartin/)
- [YouTube](https://www.youtube.com/@MartinGaray)
- [martingaray.com.ar](https://www.martingaray.com.ar/)
- [Chair of the Technology Committee at CACE, Argentina's ecommerce chamber](https://cace.org.ar/pages/comision-de-tecnologia?utm_source=cookingmetrics.com&utm_medium=referral&utm_campaign=perfil-martin&utm_content=caja-autor)
- [Ecommerce metrics dashboard, free for CACE members](https://cace.org.ar/pages/dashboard-de-metricas?utm_source=cookingmetrics.com&utm_medium=referral&utm_campaign=perfil-martin&utm_content=caja-autor)

---

## About CookingMetrics

CookingMetrics provides Google Analytics consulting, measurement implementation and SEO. Founder Martín Garay brings more than 20 years of experience in Analytics, development and ecommerce. The work connects data with business decisions.

### Services

- **[Google Analytics audit](https://cookingmetrics.com/data-analytics-consulting/)**: Do purchases or revenue differ from your store? We review your measurement and deliver a correction plan in 10 business days. [See the audit scope](https://cookingmetrics.com/data-analytics-consulting/).
- **[Google Tag Manager](https://cookingmetrics.com/services/gtm/)**: Did events stop being tracked after a website change? We review tags, triggers and versions to find duplicates or missing data. [Ask about Google Tag Manager audits and implementation](https://cookingmetrics.com/services/gtm/).
- **[Server-side measurement](https://cookingmetrics.com/services/cookieless-tracking/)**: We assess how to send data from your server, respect consent and prevent duplication. [What's included in server-side measurement](https://cookingmetrics.com/services/cookieless-tracking/).
- **[Technical SEO](https://cookingmetrics.com/services/technical-seo/)**: Have you migrated your site, or are pages missing from Google? We review crawling, indexing, structure and performance. [How we approach technical SEO](https://cookingmetrics.com/services/technical-seo/).
- **[SEO for AI search (GEO)](https://cookingmetrics.com/services/seo-ai-geo/)**: We review whether search engines and assistants can access your pages and understand their content. [What we can improve for AI search](https://cookingmetrics.com/services/seo-ai-geo/).

**Let's talk about your measurement:** [Contact us](https://cookingmetrics.com/about-martin-garay/) · [CookingMetrics](https://cookingmetrics.com/)
