Building a Zero-Cost SEO Prerender Pipeline for My React SPA on AWS
How I built a self-hosted prerender cache using CloudFront Functions, Lambda, Puppeteer, and S3 — replacing a $49/month service with existing AWS infrastructure. Inspiration This blog was inspired ...

Source: DEV Community
How I built a self-hosted prerender cache using CloudFront Functions, Lambda, Puppeteer, and S3 — replacing a $49/month service with existing AWS infrastructure. Inspiration This blog was inspired by Avinash Dalvi's excellent post on replacing prerender.io with a serverless renderer on AWS. His approach uses Lambda@Edge + API Gateway + a container-based Puppeteer Lambda. I had the same core idea and adapted it to my stack — a React SPA on CloudFront with CDK — making different architectural trade-offs along the way for my use case. Why Prerendering Matters for SPAs Already know why SPAs are invisible to crawlers? Skip ahead to The Site. Your SPA ships an index.html with an empty <div id="root"></div> and a script tag in the body. Browsers execute the JS and render everything. Crawlers and social bots don't — they read the raw HTML and move on. <!DOCTYPE html> <html> <head><title>Vairaa</title></head> <body> <div id="root"><