@Override
	public void accept(ServerWebExchange exchange, CachedResponse cachedResponse) {
		ServerHttpResponse response = exchange.getResponse();
		long calculatedMaxAgeInSeconds = calculateMaxAgeInSeconds(exchange.getRequest(), cachedResponse,
				configuredTimeToLive);
		rewriteCacheControlMaxAge(response.getHeaders(), calculatedMaxAgeInSeconds);
	}
@Test
	void maxAgeIsDecreasedByTimePassed_whenFilterIsAppliedAfterSecondsLater() {
		Duration timeToLive = Duration.ofSeconds(30);
		CachedResponse inputCachedResponse = CachedResponse.create(HttpStatus.OK).timestamp(clock.instant()).build();

		SetMaxAgeHeaderAfterCacheExchangeMutator toTest = new SetMaxAgeHeaderAfterCacheExchangeMutator(timeToLive,
				clock, false);
		toTest.accept(inputExchange, inputCachedResponse);
		Optional<Long> firstMaxAgeSeconds = parseMaxAge(inputExchange.getResponse());

		SetMaxAgeHeaderAfterCacheExchangeMutator toTestSecondsLater = new SetMaxAgeHeaderAfterCacheExchangeMutator(
				timeToLive, clockSecondsLater, false);
		toTestSecondsLater.accept(inputExchange, inputCachedResponse);
		Optional<Long> secondMaxAgeSeconds = parseMaxAge(inputExchange.getResponse());

		assertThat(firstMaxAgeSeconds).contains(timeToLive.getSeconds());
		assertThat(secondMaxAgeSeconds).contains(timeToLive.getSeconds() - SECONDS_LATER);
	}