How can I enable or disable caching in nest js?

Viewed 347

Let us say we would want to disable cache when running on dev server and enable caching mechanism on prod server instead of adding and removing the CacheInterceptor interceptor. How would we go about it?

@Get()
@UseInterceptors(CacheInterceptor)
getData()
  return "here is your data";
}
0 Answers
Related