Performance: ResponseEntity for full response control
MEDIUM IMPACT
This affects server response time and network payload size, impacting how fast the client receives and renders the response.
public ResponseEntity<String> getData() {
return ResponseEntity
.status(HttpStatus.OK)
.header("Cache-Control", "max-age=3600")
.body("data");
}public String getData() {
return "data";
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Returning raw body string | N/A | N/A | N/A | [OK] |
| Using ResponseEntity with headers and status | N/A | N/A | N/A | [OK] Good |