amp-sw icon indicating copy to clipboard operation
amp-sw copied to clipboard

Offline page not working

Open sebastianbenz opened this issue 5 years ago • 2 comments

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

sebastianbenz avatar Aug 13 '19 08:08 sebastianbenz

Once implemented, I feel ampproject/amp.dev#589 will have been addressed as a revision of the SW's implementation will have been made. You all have made a lot of progress towards satisfying Lighthouse's PWA criteria since I filed that issue two years ago. Good work! 👍

DerekNonGeneric avatar Aug 20 '19 18:08 DerekNonGeneric

@kristoferbaxter Any update on this ?

seomaz avatar May 12 '20 16:05 seomaz