Skip to content

Offline page not working #49

@sebastianbenz

Description

@sebastianbenz

The offline page is currently not working for amp.dev. Here is our serviceworker:

importScripts('https://cdn.ampproject.org/sw/amp-sw.js');
AMP_SW.init({
  assetCachingOptions: [{
    regexp: /\.(png|jpg|woff2|woff|css|js)/,
    cachingStrategy: 'CACHE_FIRST',
  }],
  offlinePageOptions: {
    url: '/offline.html',
    assets: [],
  },
});

Steps to reproduce:

  1. visit amp.dev
  2. open DevTools and check if sw is installed and /offline.html is cached
  3. Trigger offline mode in DevTools
  4. Reload the page => works
  5. click a link to an uncached page
    => no offline page is shown

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions