Class ResponseCreationSupport.DefaultMaxAgeCalculator

java.lang.Object
org.jgrapes.http.ResponseCreationSupport.DefaultMaxAgeCalculator
All Implemented Interfaces:
ResponseCreationSupport.MaxAgeCalculator
Enclosing class:
ResponseCreationSupport

DefaultMaxAgeCalculator provides an implementation that tries to guess a good max age value by looking at the path of the requested resource.

If the path contains the pattern “dash, followed by a number, followed by a dot and a number” it is assumed that the resource is versioned, i.e. its path changes if the resource changes. In this case a max age of one year is returned. In all other cases, a max age value of 60 (one minute) is returned.