Recall & Review
beginner
What is a cache store in the context of NestJS?
A cache store in NestJS is a place where data is temporarily saved to speed up repeated requests. It helps avoid fetching or computing the same data multiple times.
Click to reveal answer
beginner
How does the in-memory cache store work in NestJS?
The in-memory cache store keeps data inside the app's memory. It is fast but data is lost if the app restarts. It is good for small, temporary caching.
Click to reveal answer
intermediate
Why use Redis as a cache store instead of memory in NestJS?
Redis stores cache data outside the app in a separate server. It keeps data even if the app restarts and can share cache between multiple app instances.
Click to reveal answer
intermediate
How do you enable caching with Redis in a NestJS app?
You install Redis, then configure NestJS CacheModule with a Redis store by providing Redis connection details. This lets NestJS use Redis to save and get cached data.
Click to reveal answer
beginner
What is a key benefit of using cache stores in web applications?
Cache stores reduce the time to get data by saving results of expensive operations. This makes apps faster and reduces load on databases or APIs.
Click to reveal answer
Which cache store keeps data only while the app is running?
✗ Incorrect
In-memory cache stores data inside the app's memory and loses it when the app stops.
What is a main advantage of Redis over in-memory cache in NestJS?
✗ Incorrect
Redis stores data outside the app, so cached data stays even if the app restarts.
How do you add caching with Redis in a NestJS app?
✗ Incorrect
NestJS CacheModule can be configured to use Redis by providing connection info.
Which of these is NOT a benefit of caching in web apps?
✗ Incorrect
Cache is temporary storage, not meant for permanent data saving.
What happens to in-memory cache data when the NestJS app restarts?
✗ Incorrect
In-memory cache is cleared when the app stops or restarts.
Explain how caching with Redis works in a NestJS application and why it might be preferred over in-memory caching.
Think about app restarts and multiple servers.
You got /4 concepts.
Describe the role of cache stores in improving web app performance and give examples of when to use memory cache versus Redis cache.
Consider speed, persistence, and app size.
You got /5 concepts.