Class AppCacheManifestTransformer

  • All Implemented Interfaces:
    ResourceTransformer

    public class AppCacheManifestTransformer
    extends ResourceTransformerSupport
    A ResourceTransformer implementation that helps handling resources within HTML5 AppCache manifests for HTML5 offline applications.

    This transformer:

    • modifies links to match the public URL paths that should be exposed to clients, using configured ResourceResolver strategies
    • appends a comment in the manifest, containing a Hash (e.g. "# Hash: 9de0f09ed7caf84e885f1f0f11c7e326"), thus changing the content of the manifest in order to trigger an appcache reload in the browser.
    All files that have the ".manifest" 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.

    Since:
    4.1
    Author:
    Brian Clozel
    See Also:
    HTML5 offline applications spec
    • Constructor Detail

      • AppCacheManifestTransformer

        public AppCacheManifestTransformer()
        Create an AppCacheResourceTransformer that transforms files with extension ".manifest".
      • AppCacheManifestTransformer

        public AppCacheManifestTransformer​(String fileExtension)
        Create an AppCacheResourceTransformer that transforms files with the extension given as a parameter.