5.6.7. Offline Capabilities

Warning

Experimental!

The technologies listed below are not supported by all browsers yet (e.g. service workers are [not implemented](https://jakearchibald.github.io/isserviceworkerready) in Safari).

Currently, together with the Polymer we offer to use Progressive Web Applications techniques such as web app manifest 2 to have native-like presence on the user’s homescreen. See the manifest.json file in Polymer client module.

There are two main approaches:

  • Service Workers which primarily used to cache the app itself. Take a look at sw-precache-config.js file generated with Polymer client. In order to enable service worker generation change assemble task of Polymer module in the following way:

    ...
    task assemble(type: NodeTask, dependsOn: installBowerPackages) {
        script = file("node_modules/gulp/bin/gulp.js")
        args = ['build-sw']
    ...

More info on how to setup and use service workers can be found here.