Performance: Status code conventions
MEDIUM IMPACT
This affects how quickly browsers and clients understand server responses, impacting perceived responsiveness and error handling.
app.get('/data', (req, res) => { res.status(404).send({ error: 'Not found' }); });
app.get('/data', (req, res) => { res.status(200).send({ error: 'Not found' }); });
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Incorrect status codes (e.g., 200 on error) | No direct DOM impact | No reflows | No paint cost | [!] OK but causes client delays |
| Correct status codes (e.g., 404, 500) | No direct DOM impact | No reflows | No paint cost | [OK] Improves client handling and responsiveness |