Performance: @Cacheable for read caching
MEDIUM IMPACT
This affects the speed of serving repeated read requests by avoiding repeated method executions and database hits.
@Cacheable("dataCache") @GetMapping("/data") public Data getData() { return database.queryData(); }
@GetMapping("/data") public Data getData() { return database.queryData(); }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No caching, direct DB call | N/A | N/A | Higher due to slower server response | [X] Bad |
| @Cacheable caching method result | N/A | N/A | Lower due to faster server response | [OK] Good |