public class CachingResourceTransformer extends java.lang.Object implements ResourceTransformer
ResourceTransformer
that checks a Cache
to see if a
previously transformed resource exists in the cache and returns it if found,
or otherwise delegates to the resolver chain and caches the result.Constructor and Description |
---|
CachingResourceTransformer(Cache cache) |
CachingResourceTransformer(CacheManager cacheManager,
java.lang.String cacheName) |
Modifier and Type | Method and Description |
---|---|
Cache |
getCache()
Return the configured
Cache . |
reactor.core.publisher.Mono<Resource> |
transform(ServerWebExchange exchange,
Resource resource,
ResourceTransformerChain transformerChain)
Transform the given resource.
|
public CachingResourceTransformer(Cache cache)
public CachingResourceTransformer(CacheManager cacheManager, java.lang.String cacheName)
public Cache getCache()
Cache
.public reactor.core.publisher.Mono<Resource> transform(ServerWebExchange exchange, Resource resource, ResourceTransformerChain transformerChain)
ResourceTransformer
transform
in interface ResourceTransformer
exchange
- the current exchangeresource
- the resource to transformtransformerChain
- the chain of remaining transformers to delegate to