The pros and cons of SSR vs SPA

2019-05-24

Single-page application (SPA)

Pros

  • No server infrastructure dependency. Can be statically hosted on an AWS S3 bucket for example.
  • Less code complexity. No server side code to maintain.

Cons

  • Only one set of meta tags. Bad for SEO.
  • Slower time to first meaningful paint.

Server side rendering (SSR)

Pros

  • Full meta tag control. Different meta tags per route, including the ability to fetch dynamic data.
  • Faster time to first meaningful paint.

Cons

  • More infrastructure overhead. Requires a server (Docker, AWS ECR/EC2, or similar alternative)
  • More code to maintain.

Resources

What is React Server Side Rendering and should I use it?