PrecacheConfigurationSettings Proto Example

Posted at

Used for Chrome/Chromium --precache-config-settings-url

or sw-precache's --config=path/to/sw-precache-config.js switch,

it may also work with Polymer-framework, since Polymer is also using the same format.

It is basically a JSON.




Example #1:
{
  staticFileGlobs: [
    'app/css/**.css',
    'app/**.html',
    'app/images/**.*',
    'app/js/**.js'
  ],
  stripPrefix: 'app/',
  runtimeCaching: [{
    urlPattern: /this\\\\.is\\\\.a\\\\.regex/,
    handler: 'networkFirst'
  }]
}



Example #2:
{
  "staticFileGlobs": [
    "app/css/**.css",
    "app/**.html",
    "app/images/**.*",
    "app/js/**.js"
  ],
  "stripPrefix": "app/"
}