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 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(HttpServletRequest request,
java.lang.String requestPath) |
Cache |
getCache()
Return the configured
Cache . |
protected Resource |
resolveResourceInternal(HttpServletRequest request,
java.lang.String requestPath,
java.util.List<? extends Resource> locations,
ResourceResolverChain chain) |
protected 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 Resource resolveResourceInternal(@Nullable HttpServletRequest request, java.lang.String requestPath, java.util.List<? extends Resource> locations, ResourceResolverChain chain)
resolveResourceInternal
in class AbstractResourceResolver
protected java.lang.String computeKey(@Nullable HttpServletRequest request, java.lang.String requestPath)
protected java.lang.String resolveUrlPathInternal(java.lang.String resourceUrlPath, java.util.List<? extends Resource> locations, ResourceResolverChain chain)
resolveUrlPathInternal
in class AbstractResourceResolver