spring-framework / org.springframework.web.servlet.mvc / WebContentInterceptor / setCacheMappings

setCacheMappings

open fun setCacheMappings(cacheMappings: Properties): Unit

Map specific URL paths to specific cache seconds.

Overrides the default cache seconds setting of this interceptor. Can specify "-1" to exclude a URL path from default caching.

Supports direct matches, e.g. a registered "/test" matches "/test", and a various Ant-style pattern matches, e.g. a registered "/t*" matches both "/test" and "/team". For details, see the AntPathMatcher javadoc.

NOTE: Path patterns are not supposed to overlap. If a request matches several mappings, it is effectively undefined which one will apply (due to the lack of key ordering in java.util.Properties).

Parameters

cacheMappings - a mapping between URL paths (as keys) and cache seconds (as values, need to be integer-parsable)

See Also
#setCacheSecondsorg.springframework.util.AntPathMatcher