HTML 5 Offline Applications have to specify a
cache.manifest file, containing a list of resources to be cached in the browser. In addition this file has to be served with the
GlassFish (v4.0.1 and older) does not serve the
cache.manifest with the require content-type, so the browser will silently ignore to locally cache resources.
Fortunately, you can easily configure Glassfish editing the
default-web.xml file in:
Add the following snippet:
in the mime-mapping section (e.g. after the line 1169) and restart GlassFish. Now you can shutdown the internet :-)
<mime-mapping> <extension>manifest</extension> <mime-type>text/cache-manifest</mime-type> </mime-mapping>
Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition
airhacks.fm the podcast:
Stay in touch: airhacks.news.