<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[RefCodeHub engineering notes]]></title><description><![CDATA[RefCodeHub engineering notes]]></description><link>https://refcodehub.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 02 Nov 2026 16:49:25 GMT</lastBuildDate><atom:link href="https://refcodehub.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Incremental IndexNow pings for a 15-locale static site: hash the HTML, not the timestamps]]></title><description><![CDATA[RefCodeHub is a static site built with Astro: 15 language versions, 375 indexable URLs in 15 per-locale sitemaps (state of the build dated 22 October…]]></description><link>https://refcodehub.hashnode.dev/incremental-indexnow-pings-for-a-15-locale-static-site-hash-the-html-not-the-timestamps</link><guid isPermaLink="true">https://refcodehub.hashnode.dev/incremental-indexnow-pings-for-a-15-locale-static-site-hash-the-html-not-the-timestamps</guid><category><![CDATA[SEO]]></category><category><![CDATA[Astro]]></category><category><![CDATA[webdev]]></category><category><![CDATA[static site]]></category><dc:creator><![CDATA[RefCodeHub]]></dc:creator><pubDate>Fri, 30 Oct 2026 02:41:25 GMT</pubDate><content:encoded><![CDATA[<p>RefCodeHub is a static site built with Astro: 15 language versions, 375 indexable URLs in 15 per-locale sitemaps (state of the build dated 22 October 2026). Every page carries hreflang alternates, so a single data change (a new fee table, a refreshed regulator register) can touch dozens of HTML files at once. Pinging every URL on every deploy would be noisy; pinging nothing means Bing and other IndexNow engines see changes late. Here is the small setup we ended up with.</p>
<h2>1. Make the build deterministic</h2>
<p>If two builds of the same content produce different bytes, every page looks "changed". We removed the sources of noise: no build timestamps in HTML, sitemap <code>lastmod</code> equals the page's <code>dateModified</code>, and that date is the newest <em>data</em> date for the page (referral terms check, newest code, register download, fee check), not the deploy date. Before hashing, the script strips framework-generated <code>data-astro-*</code> attributes, which can differ between builds.</p>
<h2>2. Hash pages and diff against the last successful ping</h2>
<p><code>scripts/indexnow.mjs</code> walks <code>dist/</code>, skips non-indexable pages, hashes the rest and compares with <code>.indexnow-state.json</code>. Only new, changed or removed URLs are POSTed to <code>https://api.indexnow.org/indexnow</code>. A rebuild without content changes sends nothing.</p>
<h2>3. Save state only after the API accepts</h2>
<ul>
<li>Before sending, the script checks that the key file is actually live on the production domain.</li>
<li>A 403 right after a deploy usually means the key file is not visible yet, so it retries (up to 3 times, 30 s apart).</li>
<li>State is written only on 200/202. Any failure means the next run resends the same diff.</li>
<li><code>--dry-run</code> lists what would be sent; <code>--all</code> resubmits everything.</li>
</ul>
<h2>4. Know what IndexNow does not do</h2>
<p>Bing, Yandex, Seznam and Naver use IndexNow; Google does not. For Google, the accurate <code>lastmod</code> values in the sitemaps do the job, so step 1 pays off twice.</p>
<h2>Takeaways</h2>
<ol>
<li>Fix determinism first; incremental pings are useless without it.</li>
<li>Persist "what was accepted", not "what was built".</li>
<li>Treat a 403 after deploy as a propagation problem before blaming the key.</li>
</ol>
<p>The site itself compares crypto exchange referral programmes: what a code actually gives, explained on <a href="https://refcodehub.com/how-referral-codes-work/">how referral codes work</a>, and the side-by-side <a href="https://refcodehub.com/compare/">exchange referral bonus comparison</a>.</p>
<p><em>Disclosure: I run RefCodeHub. The site earns a commission on codes marked as ours. This is not investment advice.</em></p>
]]></content:encoded></item></channel></rss>