Deployment and observability
A green deployment only proves the build finished. Production confidence comes from knowing what the application does after real traffic arrives.
Understand what your hosting platform is doing for you
Next.js can run in different deployment environments, but caching, image optimisation, runtime support, and server behaviour depend on how the platform implements them.
If you self-host, read the deployment guidance instead of assuming a Node process behind a reverse proxy behaves exactly like a managed Next.js platform.
Inspect the real response
Check headers, redirects, canonical URLs, cookies, robots.txt, sitemap.xml, and caching on the deployed domain. Local assumptions are not evidence of production behaviour.
For caching problems, identify which layer a header describes before concluding that the page is or is not cached.
Monitor the things that hurt users
- Unhandled server and client errors.
- Slow routes and slow database queries.
- Core Web Vitals.
- Failed Server Actions and Route Handlers.
- External API latency and failures.
- Background jobs if the application uses them.
- Unexpected cache misses or stale-data incidents where relevant.
Logs should help answer a question
A wall of console output is not observability. Use structured context so a production error can be connected to a route, operation, and request without exposing sensitive data.
Add correlation identifiers when one user action crosses several services.
Can you explain “Deployment and observability” without reaching for the API reference?
Describe the main trade-off, one failure mode, and the decision you would make in a real project.