-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Improve documentation of spring.cache.type=none #33694
Comments
Can I take up this issue? |
Thanks for your interest in contributing but we generally find documentation updates are better handled by the core team. I'm not sure if we have any at the moment, but please keep an eye out for unassigned issues labelled with ideal for contribution or, if you haven't contributed before, first-timers only. |
I am more than happy to improve the doc but I fail to see what the exact problem this causes.
This is the exact same behavior for anything auto-configuration related. If you're taking control over things, we don't override your decisions. I am not sure I am following the argument. If you set You're also turning your setup into a general problem that it isn't. If you have I disagree with 1, 2, and 3 for the reason above. 4 is indeed an oversight. Thoughts? @pernelkanic hopefully the above should explain further what Andy stated above. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
No it isn't. Technically it is part of the |
Summary
The doc can be interpreted such that
spring.cache.type=none
disables caching, when in fact it's not really what it does. The documentation or behavior of Spring Boot should be improved in this regard.Details
If you want to disable caching, you'll quickly find this in the documentation:
So you do that and think your caching is disabled but if you have an explicit
CacheManager
configured, it is not. This is because all cache configs are@Conditional({ CacheCondition.class })
and@ConditionalOnMissingBean(CacheManager.class)
.Therefore, if you specify
spring.cache.type=none
, all that happens is thatNoOpCacheConfiguration
will be loaded if there is noCacheManager
bean.This is partially explained in the docs:
In this list,
None
is missing, even thoughNoOpCacheConfiguration
is also considered, further contributing to the confusion.I think that:
none
only applies when theCacheManager
is auto-configured, not if it's explicitly specified.none
should disable caching even if there is an explicitCacheManager
CacheManager
is specified andspring.cache.type
isnone
None
should also be listedThe text was updated successfully, but these errors were encountered: