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 String |
RESOLVED_RESOURCE_CACHE_KEY_PREFIX |
static String |
RESOLVED_URL_PATH_CACHE_KEY_PREFIX |
logger
Constructor and Description |
---|
CachingResourceResolver(Cache cache) |
CachingResourceResolver(CacheManager cacheManager,
String cacheName) |
Modifier and Type | Method and Description |
---|---|
protected String |
computeKey(ServerWebExchange exchange,
String requestPath) |
Cache |
getCache()
Return the configured
Cache . |
protected reactor.core.publisher.Mono<Resource> |
resolveResourceInternal(ServerWebExchange exchange,
String requestPath,
List<? extends Resource> locations,
ResourceResolverChain chain) |
protected reactor.core.publisher.Mono<String> |
resolveUrlPathInternal(String resourceUrlPath,
List<? extends Resource> locations,
ResourceResolverChain chain) |
resolveResource, resolveUrlPath
public static final String RESOLVED_RESOURCE_CACHE_KEY_PREFIX
public static final String RESOLVED_URL_PATH_CACHE_KEY_PREFIX
public CachingResourceResolver(Cache cache)
public CachingResourceResolver(CacheManager cacheManager, String cacheName)
public Cache getCache()
Cache
.protected reactor.core.publisher.Mono<Resource> resolveResourceInternal(@Nullable ServerWebExchange exchange, String requestPath, List<? extends Resource> locations, ResourceResolverChain chain)
resolveResourceInternal
in class AbstractResourceResolver
protected String computeKey(@Nullable ServerWebExchange exchange, String requestPath)
protected reactor.core.publisher.Mono<String> resolveUrlPathInternal(String resourceUrlPath, List<? extends Resource> locations, ResourceResolverChain chain)
resolveUrlPathInternal
in class AbstractResourceResolver