Document media type registration for appcache files
Since appcache manifests can have various file extensions, developers should register the (file extension, media type) mapping in their Spring MVC / Reactive Web configuration. This commit adds javadoc on both `AppCacheManifestTransformer` variants to explain how to do that. Issue: SPR-14510
This commit is contained in:
@@ -53,13 +53,16 @@ import org.springframework.web.server.ServerWebExchange;
|
|||||||
* of the manifest in order to trigger an appcache reload in the browser.
|
* of the manifest in order to trigger an appcache reload in the browser.
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* All files that have the ".appcache" file extension, or the extension given
|
* <p>All files that have the ".appcache" file extension, or the extension given in the constructor,
|
||||||
* in the constructor, will be transformed by this class.
|
* 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
|
||||||
* <p>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.
|
* or the manifest itself should invalidate the browser cache.
|
||||||
*
|
*
|
||||||
|
* <p>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 Rossen Stoyanchev
|
||||||
* @author Brian Clozel
|
* @author Brian Clozel
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
|
|||||||
@@ -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.
|
* thus changing the content of the manifest in order to trigger an appcache reload in the browser.
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* All files that have the ".appcache" file extension, or the extension given in the constructor,
|
* <p>All files that have the ".appcache" file extension, or the extension given in the constructor,
|
||||||
* will be transformed by this class.
|
* 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.
|
||||||
*
|
*
|
||||||
* <p>This hash is computed using the content of the appcache manifest and the content of the linked resources;
|
* <p>In order to serve manifest files with the proper {@code "text/manifest"} content type,
|
||||||
* so changing a resource linked in the manifest or the manifest itself should invalidate the browser cache.
|
* it is required to configure it with
|
||||||
|
* {@code contentNegotiationConfigurer.mediaType("appcache", MediaType.valueOf("text/manifest")}
|
||||||
|
* in a {@code WebMvcConfigurerAdapter}.
|
||||||
*
|
*
|
||||||
* @author Brian Clozel
|
* @author Brian Clozel
|
||||||
* @since 4.1
|
* @since 4.1
|
||||||
|
|||||||
Reference in New Issue
Block a user