amp-sw
amp-sw copied to clipboard
Offline page not working
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:
- visit amp.dev
- open DevTools and check if sw is installed and
/offline.html
is cached - Trigger offline mode in DevTools
- Reload the page => works
- click a link to an uncached page => no offline page is shown
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! 👍
@kristoferbaxter Any update on this ?