Performance: Status code usage patterns
MEDIUM IMPACT
This affects server response time and client rendering speed by controlling how quickly browsers and clients understand the result of a request.
res.status(404).send({ error: 'User not found' });
res.status(200).send({ error: 'User not found' });
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Incorrect status code (e.g., 200 on error) | No direct DOM impact | No reflows | No paint cost | [X] Bad |
| Correct status code (e.g., 404, 500) | No direct DOM impact | No reflows | No paint cost | [OK] Good |
| Meta refresh redirect | No direct DOM impact | Blocks rendering until meta processed | Delays paint | [X] Bad |
| HTTP redirect status (301/302) | No direct DOM impact | No reflows | No paint cost | [OK] Good |