Performance: Cache decorators
MEDIUM IMPACT
Cache decorators improve response time by storing results and reducing repeated processing, impacting page load speed and interaction responsiveness.
@UseInterceptors(CacheInterceptor) async getData() { return await this.service.fetchData(); }
async getData() { // heavy computation or DB call return await this.service.fetchData(); }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No caching | N/A | N/A | N/A | [X] Bad |
| With cache decorators | N/A | N/A | N/A | [OK] Good |