---
type: Migration Guide
title: "SPA to prerendered architecture migration"
description: "Add the ostr.io prerendering layer to a client-rendered SPA without rewriting it. The migration that buys crawler reach without an SSR rebuild."
resource: "https://prerendering.com/migrations/spa-to-prerendered"
tags: [migration, moderate]
timestamp: 2026-05-11T00:00:00Z
---

# SPA to prerendered architecture migration

Add the ostr.io prerendering layer to a client-rendered SPA without rewriting it. The migration that buys crawler reach without an SSR rebuild.

A migration guide for teams running a React, Vue, or Svelte SPA where rewriting to SSR is too costly but crawlers (especially AI crawlers) cannot see the content. The ostr.io prerendering service renders, caches, and serves static HTML snapshots to bots, keeping the SPA architecture intact for users — the migration reduces to routing bot traffic to the service.

- Difficulty: Moderate
- Typical duration: 1 to 3 hours

## Preflight

- Confirm the SPA is hitting real indexation problems (not just suspected ones) via Search Console URL Inspection.
- Create an ostr.io account, register your domain, and copy the Basic auth token from the integration guide — the service replaces any self-hosted rendering cluster.
- Inventory routes that need prerendering vs routes that should remain SPA-only (auth-walled, etc.).
- Verify that current canonical, OG, and JSON-LD logic works at first paint, not after JS hydration.
- Plan bot-detection rules at the edge or at the origin proxy.

## Steps

- **Connect the ostr.io prerendering service** — No infrastructure to deploy — point a request at https://render.ostr.io/?url=<page URL> with your auth token and verify it renders a sample route correctly.
- **Wire bot detection at edge or proxy** — Add user-agent based routing using a ready-made integration (Cloudflare Worker, Vercel middleware, AWS Lambda, or an Nginx/Apache rule): verified bots (Googlebot, OAI-SearchBot, PerplexityBot, etc.) go to the ostr.io renderer; humans go to SPA origin.
- **Validate semantic parity** — Diff SPA-rendered content vs prerendered HTML. Visible content must match — different markup is fine, different meaning is cloaking.
- **Roll out per route family** — Start with one route template (e.g., product pages). Verify Search Console picks up the new HTML over 7-14 days. Expand to more templates.
- **Configure cache TTL and purging** — Set the cache TTL in the ostr.io dashboard to match content freshness requirements, and use the cache purge API or dashboard when content updates.

## Rollback

- Disable bot routing at the edge — bots fall back to SPA origin (slow but functional).
- Keep bot detection toggleable per route family for partial rollback.
- Keep the ostr.io account active even after rollback so re-enabling is a config flip, not a re-setup.

## Monitoring

- Search Console Page indexing — expect indexation improvement within 14-28 days.
- Crawler hit rate in server logs — segment by verified bot user-agent.
- AI engine citation rate (manual sampling weekly) for branded and category queries.
- Prerender cache hit ratio — should stabilize above 85% for healthy operation.
- Origin load — bot traffic should be largely offloaded, freeing capacity.

## Metrics

- Expected downtime: < 15 min (edge config flip)
- Typical rollback time: < 5 min
- Time to first verified indexation: 14-28 days
- Typical prerender cache hit ratio target: > 85%

## Related

- [Redirect Bot Traffic to Prerendering](/blog/redirect-bot-traffic-to-prerendering.md)
- [Which Pages Should Use Prerendering](/blog/which-pages-should-use-prerendering.md)
- [Bot Detection and Offloading via Prerendering](/blog/bot-detection-and-offloading-bot-visits.md)
