spring-framework / org.springframework.web.servlet.resource / CachingResourceTransformer

CachingResourceTransformer

open class CachingResourceTransformer : ResourceTransformer

A org.springframework.web.servlet.resource.ResourceTransformer that checks a org.springframework.cache.Cache to see if a previously transformed resource exists in the cache and returns it if found, and otherwise delegates to the resolver chain and saves the result in the cache.

Author
Rossen Stoyanchev

Since
4.1

Constructors

<init>

CachingResourceTransformer(cache: Cache)
CachingResourceTransformer(cacheManager: CacheManager, cacheName: String)

Functions

getCache

open fun getCache(): Cache

Return the configured Cache.

transform

open fun transform(request: HttpServletRequest, resource: Resource, transformerChain: ResourceTransformerChain): Resource