Performance: Status codes and headers
MEDIUM IMPACT
This affects how quickly the browser understands the server response and how efficiently it processes caching and content rendering.
res.status(200).set({ 'Cache-Control': 'public, max-age=3600' }).send(data);
res.status(200).send(data); // No caching headers or incorrect status code for errors
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No caching headers, incorrect status codes | N/A | 0 | 0 | [X] Bad |
| Correct status codes with caching headers | N/A | 0 | 0 | [OK] Good |