-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Open
Labels
status: waiting-for-triageAn issue we've not yet triaged or decided onAn issue we've not yet triaged or decided on
Description
Hello,
When static methods are used for cache key creation and 2 static methods have the same signature in a class inheritance hierarchy, then only one static method is used for cache key generation. I created a small example project: https://github.com/fibsifan/spring-cache-error
The most relevant part is in the Controller:
@Cacheable(cacheNames = "cachedController", key = "T(de.jball.spring.caching.keys.ParentCacheKeyGenerator).getCacheKey()")
@GetMapping("parent")
public String getResponseWithParentCacheKey() {
return "ResponseWithParentCacheKey";
}
@Cacheable(cacheNames = "cachedController", key = "T(de.jball.spring.caching.keys.ChildCacheKeyGenerator).getCacheKey()")
@GetMapping("child")
public String getResponseWithChildCacheKey() {
return "ResponseWithChildCacheKey";
}
If GET http://localhost:8080/parent
is called first, then calls to /child
always return ResponseWithParentCacheKey
and vice versa.
Metadata
Metadata
Assignees
Labels
status: waiting-for-triageAn issue we've not yet triaged or decided onAn issue we've not yet triaged or decided on