Performance: Why REST design principles matter
HIGH IMPACT
This affects how quickly and efficiently a web API responds and scales under load, impacting server response time and client rendering speed.
app.get('/users/:id', (req, res) => { /* fetch user data by id */ });
app.post('/getUserData', (req, res) => { /* fetch user data */ });
| Pattern | Server Processing | Caching | Network Overhead | Verdict |
|---|---|---|---|---|
| Using POST for data retrieval | High CPU usage | No caching | High | [X] Bad |
| Using GET with resource paths | Low CPU usage | Cacheable | Low | [OK] Good |
| Stateful session management | High memory use | No caching | High | [X] Bad |
| Stateless API requests | Low memory use | Cacheable | Low | [OK] Good |