Feature Request: Ability to configure excluded endpoints for Cache Interceptor
See original GitHub issueI’m submitting a…
[ ] Regression
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
The Cache Interceptor applies to every Get endpoint in a Controller with the @UseInterceptors(CacheInterceptor)
applied to the Class.
Where the Cache Interceptor is configured globally, it applies to every Get endpoint in the entire application.
Expected behavior
It would be convenient to be able to configure Cache to be globally on, but be able identify specific Get endpoints where it does not apply.
What is the motivation / use case for changing the behavior?
I would like the convenience and consistency of a globally applied cache for read requests - with the ability to identify endpoints that are not cached
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Istio 1.14 Change Notes
Added new configuration options to istio-iptables and istio-clean-iptables for including/excluding certain user groups from interception of ...
Read more >Contexts and Dependency Injection - Quarkus
In such case, it's possible to exclude types and dependencies from the bean discovery. The quarkus.arc.exclude-types property accepts a list of string ...
Read more >Secure Endpoint Best Practices Guide - Cisco
Secure Endpoint policies need to be configured so that the features selected provide the best endpoint security while users are not impacted by...
Read more >Spring Security bypass URL or Filter - java - Stack Overflow
The issue is that the filter executes correctly for every single URI, but I want to be able to exclude some endpoints from...
Read more >Cloud Native Applications - Spring
The starting point is a set of features to which all components in a ... for common configuration files and has endpoints for...
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
@kamilmysliwiec - thanks for the reply and example.
For me, I think it will be easier and more maintainable to create a NoCache decorator, that can be applied to the desired endpoints (and honored by the HttpCacheInterceptor).
LMK if this is something you would be interested in for the NestJS common library, and I can have a go at creating a PR for this.
I have no problem with new decorators and features, as long as they’re not in the core package. Be careful the common package doesn’t get bloated with useless features for a lot of people, instead it should belong in their own official package, such as
@nestjs/cache