类 CachingResourceResolver
- java.lang.Object
- org.springframework.web.reactive.resource.AbstractResourceResolver
- org.springframework.web.reactive.resource.CachingResourceResolver
- 所有已实现的接口:
ResourceResolver
public class CachingResourceResolver extends AbstractResourceResolver
AResourceResolverthat resolves resources from aCacheor otherwise delegates to the resolver chain and caches the result.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Brian Clozel
字段概要
字段 修饰符和类型 字段 说明 static StringRESOLVED_RESOURCE_CACHE_KEY_PREFIXThe prefix used for resolved resource cache keys.static StringRESOLVED_URL_PATH_CACHE_KEY_PREFIXThe prefix used for resolved URL path cache keys.从类继承的字段 org.springframework.web.reactive.resource.AbstractResourceResolver
logger
构造器概要
构造器 构造器 说明 CachingResourceResolver(Cache cache)CachingResourceResolver(CacheManager cacheManager, String cacheName)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected StringcomputeKey(ServerWebExchange exchange, String requestPath)CachegetCache()Return the configuredCache.List<String>getContentCodings()Return a read-only list with the supported content codings.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)voidsetContentCodings(List<String> codings)Configure the supported content codings from the "Accept-Encoding" header for which to cache resource variations.从类继承的方法 org.springframework.web.reactive.resource.AbstractResourceResolver
resolveResource, resolveUrlPath
字段详细资料
RESOLVED_RESOURCE_CACHE_KEY_PREFIX
public static final String RESOLVED_RESOURCE_CACHE_KEY_PREFIX
The prefix used for resolved resource cache keys.- 另请参阅:
- 常量字段值
RESOLVED_URL_PATH_CACHE_KEY_PREFIX
public static final String RESOLVED_URL_PATH_CACHE_KEY_PREFIX
The prefix used for resolved URL path cache keys.- 另请参阅:
- 常量字段值
构造器详细资料
CachingResourceResolver
public CachingResourceResolver(Cache cache)
CachingResourceResolver
public CachingResourceResolver(CacheManager cacheManager, String cacheName)
方法详细资料
setContentCodings
public void setContentCodings(List<String> codings)
Configure the supported content codings from the "Accept-Encoding" header for which to cache resource variations.The codings configured here are generally expected to match those configured on
EncodedResourceResolver.setContentCodings(List).By default this property is set to ["br", "gzip"] based on the value of
EncodedResourceResolver.DEFAULT_CODINGS.- 参数:
codings- one or more supported content codings- 从以下版本开始:
- 5.1
getContentCodings
public List<String> getContentCodings()
Return a read-only list with the supported content codings.- 从以下版本开始:
- 5.1
resolveResourceInternal
protected reactor.core.publisher.Mono<Resource> resolveResourceInternal(@Nullable ServerWebExchange exchange, String requestPath, List<? extends Resource> locations, ResourceResolverChain chain)
computeKey
protected String computeKey(@Nullable ServerWebExchange exchange, String requestPath)
resolveUrlPathInternal
protected reactor.core.publisher.Mono<String> resolveUrlPathInternal(String resourceUrlPath, List<? extends Resource> locations, ResourceResolverChain chain)