If this period is {@link #INDEFINITELY} then this method will fail asit does not know how to map it to a simple number of milliseconds.
231232233234235236237238239240241
headers.remove(oldHeader); } } // compute the current age final Period currentAge = state.getCurrentAge(clock.getCurrentTime()); final long currentAgeLong = currentAge.inMillis() / 1000; final int currentAgeInt; if (currentAgeLong > Integer.MAX_VALUE) { currentAgeInt = Integer.MAX_VALUE; } else { currentAgeInt = (int) currentAgeLong;
8283848586878889909192
throw new IllegalArgumentException( "Statistics not gathered from same source"); } Period period = gatherTime.getPeriodSince(snapshot.gatherTime); if (period.inMillis() < 0) { throw new IllegalArgumentException("Other snapshot must have been " + "gathered before this snapshot"); } int deltaHitCount = getHitCount() - snapshot.getHitCount();
585586587588589590591592593594595
// compute max-age value final Period timeToLive = cachingDirectives.getTimeToLive(); long maxAgeInSeconds = 0; if (timeToLive != null) { maxAgeInSeconds = LongHelper.asInt(timeToLive.inMillis() / 1000); if (maxAgeInSeconds < 0) { maxAgeInSeconds = 0; } } response.addHeader("Cache-Control", "max-age=" + maxAgeInSeconds);
113114115116117118119120121122123
context.getEnvironmentContext().getCachingDirectives(); long timeToLive = -1; if (cachingDirectives != null) { final Period ttl = cachingDirectives.getTimeToLive(); if (ttl != null) { timeToLive = ttl.inMillis(); } } // Create and store CSS Cache Entry. final CacheIdentity identity =