SPA vs SSR
Compare WordPress-hosted SPA mode with serverless SSR mode.
eddev can render the same site in two modes. The route authority does not change: WordPress still decides what each URL means. The difference is where the React view is rendered for the first response.
Quick Comparison
| Topic | SPA Mode | SSR Mode |
|---|---|---|
| First request handled by | WordPress origin, such as Local or WP Engine | JavaScript server, usually Vercel in production |
| Initial HTML | App shell plus embedded route data | Server-rendered page HTML plus hydration data |
| React rendering | Browser renders the page after JavaScript loads | Server renders first, browser hydrates after load |
| WordPress role | CMS, admin, routing, GraphQL execution, route payloads | Same role: CMS, admin, routing, GraphQL execution, route payloads |
| Best use | Origin previews, fallback behavior, direct Local/WP Engine frontend checks | Normal public frontend and day-to-day local development |
| Production host | WP Engine can serve it directly, but this is not the preferred public path | Vercel serves the public site while WP Engine remains the CMS origin |
Local Development
When working locally with Local, the two modes usually appear as two nearby URLs:
| URL | What You Are Seeing |
|---|---|
https://my-site.local | The WordPress-hosted SPA frontend from Local. |
https://my-site.local:8080 | The local eddev serverless dev server, using Local as the WordPress origin. |
Use the :8080 serverless dev URL for normal frontend work. It is closer to the Vercel production path and catches SSR-specific issues earlier.
The direct .local URL is still useful when you need to inspect the WordPress origin, confirm the fallback SPA bundle, or work with admin/editor behavior that depends on WordPress-hosted assets.
Production Hosting
The common production setup is:
| Host | Purpose |
|---|---|
WP Engine origin, often on a cms. hostname | WordPress admin, content editing, route payloads, GraphQL, uploads, REST endpoints, and previews. |
| Vercel public frontend | Server-rendered public pages, client navigation, serverless routes, and public domains. |
Vercel is not replacing WordPress routing. It renders the public response after asking WordPress what the route is and what data belongs to it.
Build Paths
SPA and SSR also have different build paths:
| Build Path | Output |
|---|---|
eddev build | WordPress-hosted frontend and admin bundles for SPA mode. |
eddev build --serverless | Serverless output for SSR mode. Vercel uses this path automatically. |
eddev dev --fast | Local GraphQL codegen plus the serverless dev server on port 8080. |
For command details, see eddev CLI. For deployment configuration, SITE_URL, SITE_API_KEY, and origin protection, see Serverless.