Not the only option, but the cleanest. Let me elaborate.
Option 1: Migrate to Next.js (Recommended)
Effort: High
Benefit: Full SSR, best AI visibility
Next.js is React-based, so migration is conceptually similar. You’re adding SSR capability, not rewriting everything.
Key changes:
- Move to Next.js routing
- Implement getServerSideProps or getStaticProps
- Adjust data fetching patterns
Option 2: Add Pre-rendering Layer
Effort: Medium
Benefit: AI crawlers get HTML, users get SPA
How it works:
- Service like Prerender.io sits in front
- Detects bot user agents (GPTBot, etc.)
- Serves pre-rendered HTML to bots
- Users still get SPA experience
Considerations:
- Additional cost
- Complexity in debugging
- Pre-rendered content must stay fresh
Option 3: Hybrid Approach
Effort: Medium
Benefit: Critical pages SSR, rest stays SPA
For marketing/content pages only:
- Build those with SSR (Next.js or separate)
- Keep app functionality as SPA
- AI visibility for what matters most
My recommendation:
If you have significant content for AI visibility, bite the bullet on Next.js. Pre-rendering adds complexity without solving the root issue.