IndexNow with Cloudflare Workers
Send IndexNow updates from a Cloudflare Worker using Secrets, waitUntil, and bounded retry behavior.
Updated September 2, 2026
Store configuration safely
Bind the key as a Worker Secret. Keep host and keyLocation in environment configuration, and never return the key from an HTTP response.
Submit in the background
ctx.waitUntil(fetch('https://api.indexnow.org/indexnow', {
method: 'POST',
headers: { 'Content-Type': 'application/json; charset=utf-8' },
body: JSON.stringify({ host: env.HOST, key: env.INDEXNOW_KEY, keyLocation, urlList }),
}));Production safeguards
- Authenticate the trigger
- Verify the CMS webhook signature or protect the endpoint with service authentication.
- Bound the batch
- Validate host consistency and enforce the 10,000 URL maximum.
- Retry selectively
- Retry network failures and 429 responses with backoff, not permanent 400-series errors.