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 Details

    • SetMaxAgeHeaderAfterCacheExchangeMutator

      public SetMaxAgeHeaderAfterCacheExchangeMutator(Duration configuredTimeToLive, Clock clock, boolean ignoreNoCacheUpdate)
  • Method Details

    • accept

      public void accept(org.springframework.web.server.ServerWebExchange exchange, CachedResponse cachedResponse)
      Specified by:
      accept in interface BiConsumer<org.springframework.web.server.ServerWebExchange, CachedResponse>