Performance: Why production readiness matters
HIGH IMPACT
This concept impacts the overall stability, speed, and reliability of a NestJS application when deployed to real users.
import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import helmet from 'helmet'; import compression from 'compression'; async function bootstrap() { const app = await NestFactory.create(AppModule); app.use(helmet()); // security headers app.use(compression()); // reduce response size app.enableShutdownHooks(); // graceful shutdown await app.listen(3000); } bootstrap();
import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); await app.listen(3000); } bootstrap();
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No production readiness setup | N/A (server-side) | N/A | N/A | [X] Bad |
| With compression and security middleware | N/A (server-side) | N/A | N/A | [OK] Good |