IndexNow x Cloudflare Pages — Instant URL submissions from sitemap.xml
Go deeper on this topic
TanStack Start × Cloudflare
Full-stack setup with TanStack Start and Cloudflare Pages, plus Tailwind v4 migration
Article 4 of 4 in this series.
Next reads
Why I Didn't Choose Next.js — The Decision Criteria for Picking TanStack Start
A record of the technical decision to choose TanStack Start + Cloudflare Pages over Next.js for a portfolio hosting 203 interactive components.
TanStack Start x Cloudflare Pages — A Complete Record of Pitfalls and Solutions
Five landmines hit while deploying TanStack Start v1 to CF Pages — Vite plugin ordering, ServerFn bugs, FOUC prevention, and more — with workarounds shown in real code.
What Broke in the Tailwind CSS v4 Migration — @custom-variant and Dark Mode Implementation Notes
Breaking changes encountered migrating from Tailwind CSS v3 to v4, and implementation patterns for dark/light mode using @custom-variant.
Use the topic hub as a map, then continue to the next article in the series. New here? Start at the home hub →
IndexNow x Cloudflare Pages — Instant URL submissions from sitemap.xml
When you publish a new page, the slowest part is often waiting to be discovered.
IndexNow is a protocol for notifying search engines that a set of URLs has changed.
On sakimyto.com, the practical workflow is: treat sitemap.xml as the source of truth and submit it right after a Cloudflare Pages deploy.
This post focuses on a repeatable implementation, not theory.
TL;DR
- Use
sitemap.xmlas the single URL source (avoid double bookkeeping) - IndexNow keys are not secrets (ownership is proven via a public file)
- Submit after deploy, not before (URLs must be live)
Minimal mental model
IndexNow requires you to prove you control the host:
- Serve
https://<HOST>/<KEY>.txtat the site root (the body is the KEY itself) - Include
keyandkeyLocationin the submission payload
In this repo, those live here:
src/config/indexnow.tspublic/<KEY>.txt
Implementation: read sitemap.xml and submit URLs
The workflow stays robust if you never manually maintain the URL list.
Instead, read public/sitemap.xml, extract <loc> entries, dedupe, and submit.
This repository uses:
scripts/submit-indexnow.ts
Two important design choices:
- Build the URL list by parsing
sitemap.xml - Exit non-zero on IndexNow failures so CI can detect outages
At the same time, sitemap generation and IndexNow submission are intentionally separated so a third-party outage won't block sitemap commits.
When to submit on Cloudflare Pages
The most common mistake is submitting before deployment.
If a crawler checks the URL and sees a 404 or old content, you've wasted the notification.
Recommended order:
bun run generate:seo(sitemap / feed / llms)bun run build(build + typecheck)- Deploy to Cloudflare Pages
- Run
bun run submit:indexnowafter deploy
This keeps your public URLs aligned with what you submit.
Extra wins (only the ones that matter)
1) Always expose your sitemap in robots.txt
In public/robots.txt, ensure you have:
Sitemap: https://sakimyto.com/sitemap.xml2) Keep sitemap URLs aligned with canonicals
Your sitemap should match your canonical URLs. For multilingual sites, also keep hreflang consistent to avoid indexing confusion.
Related repo docs
docs/runbooks/indexnow-setup.md(key generation + verification)scripts/generate-seo.ts(sitemap / llms / feed generation)scripts/submit-indexnow.ts(IndexNow submission)
If you ship content regularly, removing the "discovery waiting time" is one of the highest-leverage small automations you can add. The simplest version is: submit automatically after each deploy.
FAQ
- Q. Is an IndexNow key secret?
- No. An IndexNow key is a public identifier. You prove host ownership by serving a text file named after the key at the site root.
- Q. Does IndexNow replace Google Search Console?
- No. IndexNow primarily targets engines like Bing and Yandex. Google doesn't support IndexNow, so you still use GSC separately.
- Q. What's the simplest way to build the URL list to submit?
- Use sitemap.xml as the source of truth. It keeps the submitted list aligned with your canonical public URLs and avoids missing newly published pages.