nestjs

How to control cache in Nestjs?

谁说我不能喝 提交于 2020-08-27 12:33:25
问题 I read the doc of nestjs recently, and learned something from it. But I found something that puzzled me. In Techniques/Caching, the doc shows me to use a decorator like @UseInterceptors(CacheInterceptor) on a controller to cache its response (default track by route). I wrote a testcase and found it's useful. But I didn't find any explanation to show how to clean the cache. That means I have to wait for the cache to expire. In my opinion, a cache store must provide an API to clear the cache by

How to control cache in Nestjs?

依然范特西╮ 提交于 2020-08-27 12:33:19
问题 I read the doc of nestjs recently, and learned something from it. But I found something that puzzled me. In Techniques/Caching, the doc shows me to use a decorator like @UseInterceptors(CacheInterceptor) on a controller to cache its response (default track by route). I wrote a testcase and found it's useful. But I didn't find any explanation to show how to clean the cache. That means I have to wait for the cache to expire. In my opinion, a cache store must provide an API to clear the cache by