spring-framework / org.springframework.web.servlet.resource / VersionResourceResolver / addContentVersionStrategy

addContentVersionStrategy

open fun addContentVersionStrategy(vararg pathPatterns: String): VersionResourceResolver

Insert a content-based version in resource URLs that match the given path patterns. The version is computed from the content of the file, e.g. "css/main-e36d2e05253c6c7085a91522ce43a0b4.css". This is a good default strategy to use except when it cannot be, for example when using JavaScript module loaders, use #addFixedVersionStrategy instead for serving JavaScript files.

Parameters

pathPatterns - one or more resource URL path patterns, relative to the pattern configured with the resource handler

Return
the current instance for chained method invocation

See Also
ContentVersionStrategy