diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/resource/AppCacheManifestTransformer.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/resource/AppCacheManifestTransformer.java index 113cf4d286..6d500ed972 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/resource/AppCacheManifestTransformer.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/resource/AppCacheManifestTransformer.java @@ -53,13 +53,16 @@ import org.springframework.web.server.ServerWebExchange; * of the manifest in order to trigger an appcache reload in the browser. * * - * All files that have the ".appcache" file extension, or the extension given - * in the constructor, will be transformed by this class. - * - *

This hash is computed using the content of the appcache manifest and the - * content of the linked resources; so changing a resource linked in the manifest + *

All files that have the ".appcache" file extension, or the extension given in the constructor, + * will be transformed by this class. This hash is computed using the content of the appcache manifest + * and the content of the linked resources; so changing a resource linked in the manifest * or the manifest itself should invalidate the browser cache. * + *

In order to serve manifest files with the proper {@code "text/manifest"} content type, + * it is required to configure it with + * {@code requestedContentTypeResolverBuilder.mediaType("appcache", MediaType.valueOf("text/manifest")} + * in {@code WebReactiveConfiguration.configureRequestedContentTypeResolver()}. + * * @author Rossen Stoyanchev * @author Brian Clozel * @since 5.0 diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/AppCacheManifestTransformer.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/AppCacheManifestTransformer.java index 4e23f9adb1..daee253997 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/AppCacheManifestTransformer.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/AppCacheManifestTransformer.java @@ -47,11 +47,15 @@ import org.springframework.util.StringUtils; * thus changing the content of the manifest in order to trigger an appcache reload in the browser. * * - * All files that have the ".appcache" file extension, or the extension given in the constructor, - * will be transformed by this class. + *

All files that have the ".appcache" file extension, or the extension given in the constructor, + * will be transformed by this class. This hash is computed using the content of the appcache manifest + * and the content of the linked resources; so changing a resource linked in the manifest + * or the manifest itself should invalidate the browser cache. * - *

This hash is computed using the content of the appcache manifest and the content of the linked resources; - * so changing a resource linked in the manifest or the manifest itself should invalidate the browser cache. + *

In order to serve manifest files with the proper {@code "text/manifest"} content type, + * it is required to configure it with + * {@code contentNegotiationConfigurer.mediaType("appcache", MediaType.valueOf("text/manifest")} + * in a {@code WebMvcConfigurerAdapter}. * * @author Brian Clozel * @since 4.1