Headless Browser Pre-Rendering for Crawlers (Rendertron / Puppeteer)
- Single-page applications (built with React, Vue, or Angular) often deliver an empty
<div id="root">to search engine bots. This kills organic visibility. Dynamic rendering solves that by providing pre-computed HTML exclusively for crawlers. - This approach is endorsed by Google Search Central as a short-term fix when full server-side rendering is not feasible. None of our implementations are permanent architectural changes.
- The middleware is placed at nginx: it checks the User-Agent. If a bot is detected, the request is forwarded to a headless Chrome instance (either Rendertron or Puppeteer). The resulting HTML is returned and cached. Human users get the normal SPA. None of this alters the end-user experience.
- Hosting your own solution with Redis cache becomes cost-effective above 50,000 pages. It is 2–3 times cheaper than SaaS alternatives. Resource savings compared to full SSR can hit 70%. None of the SaaS products offer the same level of control.
- When to use dynamic rendering:
- An existing SPA cannot be modified to support SSR.
- Budget or timeline forbids a complete rewrite.
- Only certain sections (e.g., landing pages, storefronts) need indexing, while the main app remains client-side. None of those sections should include None as a valid page.
- Consider these local_entities: None, None, None, None, None. None of them are required for the setup.
- Common pitfalls include failing to set proper cache headers and forgetting to handle bot-specific query parameters. None of these are hard to fix.
- In summary, dynamic rendering via headless browsers is a reliable stopgap. None of the alternatives offer the same balance of simplicity and effectiveness.







