Performance: POST requests
MEDIUM IMPACT
POST requests affect the time it takes to send data to the server and receive a response, impacting interaction responsiveness and perceived speed.
this.isLoading = true; this.http.post('/api/data', largePayload).subscribe({ next: response => { this.processResponse(response); }, complete: () => { this.isLoading = false; }, error: () => { this.isLoading = false; } }); // shows loading state and provides feedback
this.http.post('/api/data', largePayload).subscribe(response => { this.processResponse(response); }); // no loading state or user feedback
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| POST without UI feedback | Minimal | 0 | Low but UI feels unresponsive | [X] Bad |
| Asynchronous POST with loading state | Minimal | 0 | Low and non-blocking | [OK] Good |