Performance: CacheModule setup
MEDIUM IMPACT
This affects server response time and reduces repeated data processing by storing results temporarily.
import { CacheModule } from '@nestjs/common'; import * as redisStore from 'cache-manager-redis-store'; @Module({ imports: [ CacheModule.register({ store: redisStore, host: 'localhost', port: 6379, ttl: 60, }), ], }) export class AppModule {}
import { CacheModule } from '@nestjs/common'; @Module({ imports: [CacheModule.register()], }) export class AppModule {}
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Default CacheModule (in-memory, no TTL) | N/A | N/A | N/A | [!] OK |
| CacheModule with Redis store and TTL | N/A | N/A | N/A | [OK] Good |