public class CachingResourceResolver extends AbstractResourceResolver
ResourceResolver
that
resolves resources from a Cache
or otherwise
delegates to the resolver chain and saves the result in the cache.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(org.springframework.cache.Cache cache) |
CachingResourceResolver(org.springframework.cache.CacheManager cacheManager,
String cacheName) |
Modifier and Type | Method and Description |
---|---|
protected String |
computeKey(HttpServletRequest request,
String requestPath) |
org.springframework.cache.Cache |
getCache()
Return the configured
Cache . |
protected org.springframework.core.io.Resource |
resolveResourceInternal(HttpServletRequest request,
String requestPath,
List<? extends org.springframework.core.io.Resource> locations,
ResourceResolverChain chain) |
protected String |
resolveUrlPathInternal(String resourceUrlPath,
List<? extends org.springframework.core.io.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(org.springframework.cache.Cache cache)
public CachingResourceResolver(org.springframework.cache.CacheManager cacheManager, String cacheName)
public org.springframework.cache.Cache getCache()
Cache
.protected org.springframework.core.io.Resource resolveResourceInternal(@Nullable HttpServletRequest request, String requestPath, List<? extends org.springframework.core.io.Resource> locations, ResourceResolverChain chain)
resolveResourceInternal
in class AbstractResourceResolver
protected String computeKey(@Nullable HttpServletRequest request, String requestPath)
protected String resolveUrlPathInternal(String resourceUrlPath, List<? extends org.springframework.core.io.Resource> locations, ResourceResolverChain chain)
resolveUrlPathInternal
in class AbstractResourceResolver