Class SetMaxAgeHeaderAfterCacheExchangeMutator
java.lang.Object
org.springframework.cloud.gateway.filter.factory.cache.postprocessor.SetMaxAgeHeaderAfterCacheExchangeMutator
- All Implemented Interfaces:
BiConsumer<org.springframework.web.server.ServerWebExchange, CachedResponse>, AfterCacheExchangeMutator
public class SetMaxAgeHeaderAfterCacheExchangeMutator
extends Object
implements AfterCacheExchangeMutator
It sets the
HttpHeaders.CACHE_CONTROL max-age value. The value is
calculated taking the configuredTimeToLive cache configuration and the age of
the entry.- Author:
- Marta Medio, Ignacio Lozano
-
Constructor Summary
ConstructorsConstructorDescriptionSetMaxAgeHeaderAfterCacheExchangeMutator(Duration configuredTimeToLive, Clock clock, boolean ignoreNoCacheUpdate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(org.springframework.web.server.ServerWebExchange exchange, CachedResponse cachedResponse) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiConsumer
andThen
-
Constructor Details
-
SetMaxAgeHeaderAfterCacheExchangeMutator
-
-
Method Details
-
accept
public void accept(org.springframework.web.server.ServerWebExchange exchange, CachedResponse cachedResponse) - Specified by:
acceptin interfaceBiConsumer<org.springframework.web.server.ServerWebExchange, CachedResponse>
-