title: Can you configure the NestJS cache TTL per-endpoint?
body: <p>I'm currently using the NestJS caching mechanism as described in the docs: <a href="https://docs.nestjs.com/techniques/caching" rel="nofollow noreferrer">https://docs.nestjs.com/techniques/caching</a></p>
  
  <p>Using this I can customise the caching of an entire module with the following:</p>
  
  <pre><code>CacheModule.register({
    ttl: 5, // seconds
    max: 10, // maximum number of items in cache
  });
  </code></pre>
  
  <p>However, there are certain <strong>endpoints</strong> that I want to cache for a longer period of time than the rest. (e.g. Long running operations that don't change as often as the others)</p>
  
  <p>Something similar was described here: <a href="https://github.com/nestjs/nest/issues/695" rel="nofollow noreferrer">https://github.com/nestjs/nest/issues/695</a> but looks like it was closed without truly solving the whole problem.</p>
  
  <p>I'm imagining something like:</p>
  
  <pre><code>@Cache({ ttl: 600 })
  @Get()
  findAll(): string[] {
    return service.longRunningOperation();
  }
  </code></pre>
  
  <p>Any thoughts?</p>