Class EncodedResourceResolver

java.lang.Object
org.springframework.web.servlet.resource.AbstractResourceResolver
org.springframework.web.servlet.resource.EncodedResourceResolver
All Implemented Interfaces:
ResourceResolver

public class EncodedResourceResolver extends AbstractResourceResolver
Resolver that delegates to the chain, and if a resource is found, it then attempts to find an encoded (e.g. gzip, brotli) variant that is acceptable based on the "Accept-Encoding" request header.

The list of supported contentCodings can be configured, in order of preference, and each coding must be associated with extensions.

Note that this resolver must be ordered ahead of a VersionResourceResolver with a content-based, version strategy to ensure the version calculation is not impacted by the encoding.

Since:
5.1
Author:
Rossen Stoyanchev