Add AppCacheResourceTransformer
This change adds a new ResourceTransformer that helps handling resources within HTML5 AppCache manifests for HTML5 offline application. This transformer: * modifies links to match the public URL paths * appends a comment in the manifest, containing a Hash (e.g. "# Hash: 9de0f09ed7caf84e885f1f0f11c7e326") See http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#offline for more details on HTML5 offline apps and appcache manifests. Here is a WebConfig example: @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { AppCacheResourceTransformer appCacheTransformer = new AppCacheResourceTransformer(); registry.addResourceHandler("/**") .addResourceLocations("classpath:static/") .setResourceResolvers(...) .setResourceTransformers(..., appCacheTransformer); } Issue: SPR-11964
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
CACHE MANIFEST
|
||||
|
||||
# this is a comment
|
||||
CACHE:
|
||||
bar.css
|
||||
foo.css
|
||||
//example.org/style.css
|
||||
|
||||
NETWORK:
|
||||
*
|
||||
|
||||
CACHE:
|
||||
js/bar.js
|
||||
http://example.org/image.png
|
||||
|
||||
FALLBACK:
|
||||
/main /static.html
|
||||
@@ -0,0 +1,4 @@
|
||||
THIS DOES NOT START WITH "CACHE MANIFEST"
|
||||
|
||||
CACHE:
|
||||
bar.css
|
||||
Reference in New Issue
Block a user