Skip to content

spring.cache.redis.cache-prefix should use prefixCacheNameWith to include the cache name in the generated key #16676

@markfredchen

Description

@markfredchen

With spring boot version 2.1.4, I found below code which doesn't serve as prefix, instead it overrides the cacheName passed in. Is it a bug? or it is by design?

public RedisCacheConfiguration prefixKeysWith(String prefix) {
	Assert.notNull(prefix, "Prefix must not be null!");
	return computePrefixWith((cacheName) -> prefix);
}

Is it support to be below code ?

public RedisCacheConfiguration prefixKeysWith(String prefix) {
	Assert.notNull(prefix, "Prefix must not be null!");
	return computePrefixWith((cacheName) -> prefix + ":" + cacheName + "::");
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions