---
title: "Comment by Sergio on \"How to exclude a route from caching in nest.js\" | Hashnode"
description: "Great article Shahid! Do I also need to include new interceptor/decorator somewhere else? Like app.module? This example didn&#39;t work for me right away... tha"
url: "https://hashnode.com/posts/how-to-exclude-a-route-from-caching-in-nestjs/61df8f356bf5f0642b8f1699/comment/632f15373ac18d0d78a02164"
---

[Discussion](https://hashnode.com/posts/how-to-exclude-a-route-from-caching-in-nestjs/61df8f356bf5f0642b8f1699)

Comment [How to exclude a route from caching in nest.js](https://hashnode.com/posts/how-to-exclude-a-route-from-caching-in-nestjs/61df8f356bf5f0642b8f1699)

[Sergio](https://hashnode.com/@Sergio7)

[Sep 24, 2022](https://hashnode.com/posts/how-to-exclude-a-route-from-caching-in-nestjs/61df8f356bf5f0642b8f1699/comment/632f15373ac18d0d78a02164)

Great article Shahid!

Do I also need to include new interceptor/decorator somewhere else? Like app.module?

This example didn't work for me right away...

thanks,

[Shahid Kamal](https://hashnode.com/@shahidcodes)

[Oct 7, 2022](https://hashnode.com/posts/how-to-exclude-a-route-from-caching-in-nestjs/61df8f356bf5f0642b8f1699/comment/632f15373ac18d0d78a02164#reply-633ffe016971ffceb981fbc2)

If you want the cache interceptor to work on the global level then add below in the `app.module.ts`

```
providers: [
   {
     provide: APP_INTERCEPTOR,
     useClass: MyCacheInterceptor,
   },
 ]
```
