NestJS · Middle · Question 35 of 75
How do you cache GET responses in Nest?
- 1With
@Header('Cache')only - ✓Correct answer: With
CacheModuleandCacheInterceptor(or by injecting the cache manager and caching manually) - 3Nest caches all responses by default
Explanation
Use a shared store like Redis with several instances, and decide how to invalidate keys on writes.