In my previous post, I walked through how we cut raw SSR HTML from 2.39 MB down to ~175 KB on a TanStack Start + Nitro + Cloudflare Workers app by removing 9,531 AI model pricing rows from the shared route loader.

Everything looked clean in Chrome after that deploy. Pages loaded quickly, client hydration fetched /api/catalog, and every interactive workspace worked.

Then I ran a 25-line raw-HTML crawler audit (zero JavaScript execution) against every URL in sitemap.xml — and 30 live HTTP 200 pages lit up with "No compatible model is available" and data-generator-unavailable right inside the SSR HTML.

Because client hydration immediately loaded the full catalog within ~200 ms, human visitors barely noticed a flash. To Googlebot and AI search crawlers inspecting the initial HTML document, 30 real product pages looked like broken empty shells — classic Soft 404s. Google Search Console had already flagged two of them.

Here is the exact two-part deadlock that caused it, the minimal 1-model SSR fix that kept HTML under 205 KB, and the CI smoke check we now run before every deploy.

1. Why humans never saw the bug (and crawlers did)

Our app mixes two kinds of public pages:

  • Browser-local tools like Photo to GIF, which run entirely on-device with zero server catalog or pricing dependencies.
  • Cloud-priced AI workspaces like Photo to Sketch and our AI Pixel Art Generator, which validate compatible models and display exact credit quotes before a user starts a job.

In the browser, the page hydrated and immediately pulled all 93 models (45 image + 48 video) from /api/catalog. On the server during SSR, however, the route loader ran a compatibility filter against a stripped catalog — got an empty array [] — and rendered our graceful "No compatible model is available" fallback state into the HTML.

Diagram comparing healthy Chrome hydration against 30 silent Soft 404 SSR responses seen by crawlers

That is the nastiest property of SSR Soft 404s: the HTTP status code is 200 OK, Chrome looks fine, and your browser E2E tests pass — while search engines quietly drop the pages from their index.

2. Root cause #1: one line in generatorProfile()

Digging into src/lib/generator-profile.ts, the model matcher filtered our catalog like this:

const models = catalog.filter( (m) => m.media === media && m.enabled && m.documented && (!m.managedYir || ordinary) && // <-- the single line ... ); 

Look closely at (!m.managedYir || ordinary):

  • ordinary was true for broad hub routes (/ai-image-generator, /ai-video-generator).
  • For 30 specialized tool routes that use exact per-tool credit quotes (hasExactToolPricing(tool.id)), ordinary was false.
  • Once we migrated our live image models onto managed gateway pricing (m.managedYir = true), that single condition filtered out every compatible managed model on all 30 specialized routes.

The fix in src/lib/generator-profile.ts was literally one extra clause:

 m.media === media && m.enabled && m.documented && - (!m.managedYir || ordinary) && + (!m.managedYir || + ordinary || + (!!tool && hasExactToolPricing(tool.id))) && 

3. Root cause #2: over-stripping yirRates in SSR

Fixing that filter line alone still wasn't enough!

To shrink SSR HTML by 92%, our shared loader pageData() had stripped yirRates from every model except single-model detail routes:

// Before: tool routes had model === undefined, so ALL 93 models lost yirRates const ssrModels = allModels.map((m) => { if (model && m.id === model.id) return m; const { yirRates: _yirRates, ...rest } = m; return rest; }); 

In live mode (publishedPricing: env.GENERATION_MODE === 'live'), our matcher checks hasPublishedImageOptions(m, true) to ensure it never quotes an unpriced model. With yirRates stripped from all 93 models on tool routes, SSR still computed zero priceable models and rendered the unavailable fallback!

Side-by-side diff of the one-line generator-profile filter fix and 1-model SSR rate retention

The minimal-SSR compromise: keep 1 matched model (~4 KB), hydrate 93 on the client

Instead of putting 1.95 MB of pricing rows back into SSR, we ran generatorProfile() once on the server for the active tool, picked the first compatible priced model, and kept only that single model's yirRates in the dehydrated payload:

const ssrRateModelIds = new Set<string>(); if (model) ssrRateModelIds.add(model.id); if (tool && !toolRecipes[tool.operation]) { const matched = generatorProfile( { media: tool.media, tool, publishedPricing: env.GENERATION_MODE === 'live', }, allModels ).models; for (const candidate of matched) { if (candidate.yirRates && Object.keys(candidate.yirRates).length) { ssrRateModelIds.add(candidate.id); if (ssrRateModelIds.size >= 1) break; } } } const ssrModels = allModels.map((m) => { if (ssrRateModelIds.has(m.id)) return m; const { yirRates: _yirRates, ...rest } = m; return rest; }); 

The numbers worked out cleanly:

  • Extra SSR weight: ~3–6 KB per tool route (keeping total raw HTML at 164–205 KB, still >91% smaller than 2.39 MB).
  • Crawler HTML: renders the real interactive workspace and an accurate credit quote immediately on first byte — zero unavailable fallback strings.
  • Client experience: once hydrated, TanStack Query fetches /api/catalog so users still get all 93 models in the model switcher.

4. The 25-line raw-HTML scanner that caught all 30 pages

Normal unit tests didn't catch this because mocks often used stub pricing or non-managed fixtures, and Playwright E2E tests waited for hydration. What caught all 30 routes in under 4 seconds was fetching the live sitemap URLs without JavaScript and scanning for fallback markers:

import concurrent.futures import urllib.request FALLBACK_MARKERS = [ "No compatible model is available", "data-generator-unavailable", "Currently unavailable", ] def audit(url: str): req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"}) raw = urllib.request.urlopen(req, timeout=20).read() html = raw.decode("utf-8", "ignore") flags = [m for m in FALLBACK_MARKERS if m in html] if len(raw) > 300_000: flags.append(f"HTML_TOO_LARGE:{len(raw)//1024}KB") return (url, flags, len(raw)) if flags else None with concurrent.futures.ThreadPoolExecutor(max_workers=10) as ex: hits = [r for r in ex.map(audit, sitemap_urls) if r] print(f"Flagged {len(hits)} / {len(sitemap_urls)} routes") 

Right after shipping the two-part fix and re-running the scanner across production Cloudflare Workers:

  • Flagged routes dropped from 30 to 0
  • Raw SSR HTML stayed between 164 KB and 205 KB across every tool page
  • After Googlebot recrawled our previously flagged routes, the GSC Soft 404 report cleared the affected tool page on the very next index snapshot

Production SSR audit showing 30 to 0 unavailable pages while preserving 164-205 KB raw HTML and 93-model client hydration

3 rules we keep in CI after this outage

  1. Test the unhydrated HTML, not just the hydrated DOM. Any "temporarily unavailable", "no data", or loading skeleton rendered on HTTP 200 during SSR is a Soft 404 risk if crawlers read first paint before an API call resolves.
  2. Pair every SSR payload trim with a live fallback scan. Shrinking dehydrated loader state is great for crawl budget, but server-side capability checks often depend implicitly on fields you just removed.
  3. Fail CI with diagnostics, not just a boolean. As a reader suggested on my last post, printing both the triggered fallback marker and the top 5 largest keys in the dehydrated payload turns a broken deploy check into a 30-second fix.

Have you ever shipped an SSR optimization that looked totally fine in the browser but broke crawler HTML? Curious what fallback strings people guard against in CI.