Skip to content

fix(indexnow): send only URLs changed since the last successful submission - #103

Merged
unfoldingdimensions merged 2 commits into
mainfrom
fix/indexnow-changed-only
Oct 9, 2026
Merged

unfoldingdimensions merged 2 commits into
mainfrom
fix/indexnow-changed-only

Conversation

@unfoldingdimensions

Copy link
Copy Markdown
Owner

Bing's IndexNow report showed 171 submissions in 8 hours: every deploy resent all ~35 sitemap URLs, docs-only deploys included. Now a deploy sends only URLs that are new or whose <lastmod> changed — and nothing when none did. (SEO build brief 2026-10-09, "Infra"; D49.)

How

  • scripts/indexnow.mjs: a pure changedUrls(previousXml, currentXml) diff (new URL or moved lastmod → send; removed → not sent; no usable previous sitemap → send all, with the reason logged). Logs IndexNow: N changed of M and the URLs when there are ≤10. The script only runs main when executed, so tests import the functions.
  • ci.yml: the baseline is the sitemap of the last successful submission, kept in the Actions cache — restored before the ping (restore-keys: indexnow-), saved only if: steps.indexnow.outcome == 'success'.

Why not "save the live sitemap before deploy" (the brief's wording)

A deploy whose smoke fails skips the ping. With a pre-deploy baseline, the next deploy's "before" already contains those pages, so they'd never be announced. #95 did exactly this today (its smoke failed on a stale pin). Baselining on the last success keeps them in the next submission (L38).

Expected

  • The first deploy after this lands sends all 35 — the cache is empty. From then on, only changes.
  • lastmod is the single CONTENT_UPDATED date (D35), so a copy change that bumps it still sends every page. Per-page dates are the upgrade, out of scope.

Verified

  • tests/indexnow.test.ts: 5 tests (docs-only deploy → nothing; new URL + moved lastmod → exactly those two; removed URL → not sent; empty / non-XML / empty <urlset> previous → all, with reason; plus the existing key test). Full suite 2024/2024, eslint and tsc clean.
  • Dry run of the diff against the live 35-URL sitemap (no POST): identical → []; one new page + one moved lastmod → those two URLs; no previous → 35 with the reason.
  • Not exercised: the cache restore/save in Actions — that runs on the first deploy after merge; check its "Ping IndexNow" line says no previous sitemap — submitting every URL, and the one after says N changed of 35.

🤖 Generated with Claude Code

unfoldingdimensions and others added 2 commits October 9, 2026 20:43
…ssion

Every deploy resent all ~35 sitemap URLs (171 submissions in 8 hours on
Bing's report), docs-only deploys included. The script now diffs the live
sitemap against the last successfully submitted one, kept in the CI cache
(restored before the ping, saved only when it succeeds), and sends new
URLs and moved lastmods only - nothing when none moved. Baselining on the
last success, not the pre-deploy sitemap, keeps pages from a deploy whose
smoke failed in the next submission. No cache: everything, once, logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…only

# Conflicts:
#	decisions.md
#	learning.md
@unfoldingdimensions
unfoldingdimensions merged commit 2898f9d into main Oct 9, 2026
3 checks passed
@unfoldingdimensions
unfoldingdimensions deleted the fix/indexnow-changed-only branch October 9, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant