Performance: Route parameters
MEDIUM IMPACT
Route parameters affect server-side request handling speed and can indirectly impact page load speed by controlling how quickly the server responds.
app.get('/user/:id/profile/:section', async (req, res) => { const data = await fetchUserData(req.params.id); res.send(data); });
app.get('/user/:id/profile/:section', (req, res) => { /* heavy synchronous processing */ });
| Pattern | Server Processing | Blocking | Response Time Impact | Verdict |
|---|---|---|---|---|
| Synchronous heavy processing in route handler | High CPU use | Blocks event loop | Increases response time significantly | [X] Bad |
| Asynchronous non-blocking route handler | Low CPU use | No blocking | Fast response time | [OK] Good |