[Feature, Question] Method level @Cache annotation
See original GitHub issueWant to implement one, but the only way to access Request, Response - via middlewares, which are outside of the controller. Is it possible using the current (3.x) version of Nest?
import { Controller, Get, Post, HttpStatus } from '@nestjs/common';
@Controller()
export class UsersController {
@Cache({period: '1m', key: (req, res) => req.originalUrl})
@Get('users')
getAllUsers() {}
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Method level @Cache annotations for Service #1032 - GitHub
I'm submitting a... [ ] Regression [ ] Bug report [x] Feature request [ ] Documentation issue or request [ ] Support request...
Read more >Spring Boot Caching - Javatpoint
It is a method level annotation. It is used when we want to remove stale or unused data from the cache. It requires...
Read more >Spring cache annotations: some tips & tricks | iO
In this post I'll assume you know how the caching annotations work and provide you with some tips & tricks for using them....
Read more >Spring Caching | Java Development Journal
The @CachePut annotation is useful if we want to update cache without affecting method execution. The @CacheEvict annotation can create an issue ...
Read more >Cache Abstraction: JCache (JSR-107) Annotations Support
@CacheResult brings the concept of exception cache: whenever a method execution failed, it is possible to cache the exception that was raised to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could we use something like this out of the box at least on the service methods?
https://www.npmjs.com/package/node-ts-cache
(Also, is there a better one out there already, or is this the place to start?)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.