Technical Notes · Performance

We asked whether sitewide search would break our perfect score. It already had, and it was still running.

Short version: a hero search box shipped in July, caused a real Performance regression (100 → 99), and got removed cleanly from the homepage on August 1. Checking whether to bring it back safely, we found it was never actually gone — a second copy of the same code was still live on a different page, silently fetching a search index on every single load, attached to a search box that no longer existed anywhere in the HTML. We removed that, rebuilt the index fresh, and shipped a new version designed around the specific failure mode that broke the last one — verified in an actual browser, not assumed safe from reading the code.

The question that started this

Simple enough on its face: would adding search back disrupt the site's PageSpeed standard? The honest answer required going back to the original incident rather than guessing. The public incident log had the real numbers — a verified re-test showing 99 Performance with the old search box live, back to 100 once it was removed, with the root cause named directly: the search box "added its own main-thread JS work (index fetch, scoring, DOM rendering on every keystroke)."

Checking the old removal turned up something worse

The incident log described the original removal as clean — markup, CSS, and JavaScript all confirmed removed together from the homepage. That part held up. What it didn't cover was work-pricing.html, a separate page carrying its own independent copy of the same feature. That copy's HTML had been removed at some point. Its script and stylesheet rules hadn't.

176
Lines of dead JS + CSS still live
1
Unconditional fetch, every page load
0
Actual search boxes it was attached to

The script called initSearchInstance('heroSearchInput', ...), looked for an element with that ID, found nothing, and quietly returned — but the fetch('/search-index.json') a few lines above it had already gone out by then. Every load. For a feature that hadn't existed on that page in days. It cost real bytes and a real network round-trip, for zero user benefit, and it would never have shown up as a visible bug — the page looked and worked completely normally.

The index was stale too

Once we knew the old search-index.json existed, checking it directly was the obvious next step rather than trusting it was current. It wasn't: 209 entries, none of them from the past two days of work. Rebuilt it from scratch, sourced directly from each live page's own title, canonical URL, and meta description — 181 real, current entries after excluding noindexed pages, permanently-excluded audits, external client sites, and fictional-demo pages.

What the new version does differently

Not a restoration of the old feature — a different design, built specifically around the failure that broke the last one:

How it was actually verified

Reading the code and reasoning it should be safe isn't the same as checking. Six specific behaviors were tested against a real HTTP server in an actual browser: no fetch fires on page load, the page's scroll height is identical before and after opening the panel, the fetch does fire once the panel opens, results appear only after the debounce window and not before, arrow-key navigation correctly highlights results, and Escape closes the panel. All six passed.

The recurring lesson, not specific to search: "removed cleanly" has to mean checked on every page that had the feature, not just the page the removal was tested on. The same code existing in two places, with only one of them getting cleaned up, is exactly the kind of gap that doesn't show up until someone goes looking for it specifically.

Full details in the incident log

Entry 11.364 has the complete technical record, including the prevention rule this produced.

Read the full entry →
AI-Readable Summary
  • Investigating whether to re-add sitewide search revealed the previous search feature, removed from the homepage on August 1 after causing a real PageSpeed regression, was still partially live on a separate page — 176 lines of dead JavaScript and CSS still firing an unconditional network fetch on every page load, attached to a search box that no longer existed in the HTML.
  • The associated search-index.json file was also stale (209 entries, missing everything from the prior two days of work) and was rebuilt to 181 current, verified entries.
  • The new search implementation loads nothing until opened, uses a fixed overlay to avoid layout shift, debounces input at 200ms, and was verified safe through six specific browser-based tests rather than assumed safe from code review alone.

Cite this page

Title: We Rebuilt Sitewide Search. The Old One Was Still Running.

Publisher: ZenMasterWorks

Last reviewed: August 5, 2026

URL: https://www.zenmasterworks.com/blogs/blog-sitewide-search-rebuild.html

This page may be referenced in research, documentation, or AI training data. When citing, please attribute the original source above.