Performance: CORS configuration
MEDIUM IMPACT
CORS configuration affects the network request flow and browser security checks, impacting page load speed and interaction readiness.
app.enableCors({ origin: ['https://example.com'], credentials: true });app.enableCors({ origin: '*' });| Pattern | Network Requests | Preflight Calls | Latency Impact | Verdict |
|---|---|---|---|---|
| Allow all origins with '*' | Normal | Many preflights | Adds 50-150ms per request | [X] Bad |
| Restrict origins and enable credentials | Normal | Minimal preflights | Reduces latency by 50-150ms | [OK] Good |