public class CachingResourceResolver extends AbstractResourceResolver
ResourceResolver
that resolves resources from a Cache
or
otherwise delegates to the resolver chain and caches the result.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RESOLVED_RESOURCE_CACHE_KEY_PREFIX |
static java.lang.String |
RESOLVED_URL_PATH_CACHE_KEY_PREFIX |
logger
Constructor and Description |
---|
CachingResourceResolver(Cache cache) |
CachingResourceResolver(CacheManager cacheManager,
java.lang.String cacheName) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
computeKey(ServerWebExchange exchange,
java.lang.String requestPath) |
Cache |
getCache()
Return the configured
Cache . |
protected reactor.core.publisher.Mono<Resource> |
resolveResourceInternal(ServerWebExchange exchange,
java.lang.String requestPath,
java.util.List<? extends Resource> locations,
ResourceResolverChain chain) |
protected reactor.core.publisher.Mono<java.lang.String> |
resolveUrlPathInternal(java.lang.String resourceUrlPath,
java.util.List<? extends Resource> locations,
ResourceResolverChain chain) |
resolveResource, resolveUrlPath
public static final java.lang.String RESOLVED_RESOURCE_CACHE_KEY_PREFIX
public static final java.lang.String RESOLVED_URL_PATH_CACHE_KEY_PREFIX
public CachingResourceResolver(Cache cache)
public CachingResourceResolver(CacheManager cacheManager, java.lang.String cacheName)
public Cache getCache()
Cache
.protected reactor.core.publisher.Mono<Resource> resolveResourceInternal(@Nullable ServerWebExchange exchange, java.lang.String requestPath, java.util.List<? extends Resource> locations, ResourceResolverChain chain)
resolveResourceInternal
in class AbstractResourceResolver
protected java.lang.String computeKey(@Nullable ServerWebExchange exchange, java.lang.String requestPath)
protected reactor.core.publisher.Mono<java.lang.String> resolveUrlPathInternal(java.lang.String resourceUrlPath, java.util.List<? extends Resource> locations, ResourceResolverChain chain)
resolveUrlPathInternal
in class AbstractResourceResolver