PWA offline mode not loading from cache on mobile browsers

前端 未结 2 686
挽巷
挽巷 2021-01-22 13:43

I wrote a simple PWA (current version) based on this tutorial by Vaadin. It works fine, tested in Chrome, also in offline mode.

By using it on a mobile device, issues oc

相关标签:
2条回答
  • 2021-01-22 14:10

    The problem was within the service-worker:

    I forgot to add the service worker file to the static assets.

    Found the solution by reading the answers of this question: https://stackoverflow.com/a/44482764/7350000.

    0 讨论(0)
  • 2021-01-22 14:29

    I had the same issue. In my case, the issue came from the manifest adding a query string to the start_url. The cache is sensitive to this. You can add an argument to .match in order to prevent it, like this:

    caches.match(event.request, {ignoreSearch: true})

    0 讨论(0)
提交回复
热议问题