public class ResponseExpirationCalculator extends Object
Given Cache-Control: max-age=5 and Cache-Control: max-age=15 the most restrictive is 5.
Given Cache-Control: max-age=5 and Cache-Control: s-maxage=15 the latter has precedence resulting in 15.
If either of Pragma: no-cache, Cache-Control: no-cache and Cache-Control: private is present the response is considered to be already-expired. Uses Apache HttpClient to parse the headers.Constructor and Description |
---|
ResponseExpirationCalculator() |
Modifier and Type | Method and Description |
---|---|
boolean |
addHeader(String name,
Object value) |
int |
getMaxAgeInSeconds()
Returns the number of seconds the response can be cached where 0 means that the its already expired and must not
be cached and -1 means that there's no information on how long it can be cached.
|
Copyright © 2015 Magnolia International Ltd.. All rights reserved.