-
Notifications
You must be signed in to change notification settings - Fork 1.7k
#741 Add filtering options and logic to caching #2337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
#741 Add filtering options and logic to caching #2337
Conversation
|
Hello, Cliff!
Well... correct, OutputCacheMiddlewareTests contains our unit tests for the
Please avoid using
Sure, our team will provide guidance, but please be patient as I'm currently swamped with the hot v24.1 release we're aiming to finish this week. Also, please include acceptance tests as they are an important part of the development process alongside integration/unit tests, and I'll arrange for the team to carry out code reviews. Good luck with the delivery! 😉 |
|
Raman, |
|
We overlooked an important detail: the global configuration, which was improved in the latest PR #2331. The current design adds a "CacheOptions": {
"TtlSeconds": 0,
"Region": "",
"StatusCodes": [400, 404, 405, 410] // excluded or included?
}I think this currently only covers the excluding scenario. We should reconsider your initial implementation to handle the including scenario as well. We also need to implement the excluding scenario explicitly. I suggest introducing groups of codes like 2xx, 3xx, 4xx, and 5xx, where having a single 200 code in the array would represent all 2xx statuses. Finally, we should add a management Boolean option to enable or disable the status codes feature on the fly, so that global status checks can be turned off for specific routes, and vice versa, re-enabled for certain routes even when globally disabled. More technical details will follow. |
Closes #741
Proposed Changes
HttpStatusCodetoFileCacheOptionsandCacheOptionsto act as a whitelist of status codes.