Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Cache not working on android Chrome #325

Closed
shablenko opened this issue Aug 31, 2017 · 3 comments
Closed

Cache not working on android Chrome #325

shablenko opened this issue Aug 31, 2017 · 3 comments
Labels

Comments

@shablenko
Copy link

Cache not working on android Chrome

new SWPrecacheWebpackPlugin(
            {
              cacheId: 'id',
              filename: 'service-worker.js',
              minify: true,
              mergeStaticsConfig: true,
              navigateFallback: '/index.html',
              staticFileGlobsIgnorePatterns: [/\.map$/],
              ignoreUrlParametersMatching: [/\?assests_hash/],
              staticFileGlobs: ['/'],
              runtimeCaching: [
                { urlPattern: /\/api\/file\/language/, handler: 'networkFirst' },
                { urlPattern: /\/api\/ruler/, handler: 'networkFirst' },
                { urlPattern: /\/api\/mint/, handler: 'networkFirst' },
                { urlPattern: /\/api\/state/, handler: 'networkFirst' },
                { urlPattern: /\/api\/denom/, handler: 'networkFirst' },
                { urlPattern: /\/api\/metal/, handler: 'networkFirst' }
              ]
            }
        ),
@jeffposnick
Copy link
Contributor

Could you elaborate on what's not working—are you seeing errors in the JavaScript console, are things completely failing to load while offline, is it the runtime caching bit that's not behaving as expected, etc.?

And you mention Android Chrome—are you seeing similar issues on desktop Chrome, and desktop Firefox, or is this limited to Android Chrome? If it's just Android Chrome, what's the version number of Chrome?

@shablenko
Copy link
Author

shablenko commented Sep 15, 2017

On desktop Chrome works fine, but on Android it seems like worker not caching index.html, maybe i should use absolute url to file?
I cannot check console, my phone doesn`t support developer mode :(

@jeffposnick
Copy link
Contributor

There shouldn't be any difference in service worker implementations between desktop and Android Chrome that would lead to this.

Do you use different URL schemes for your mobile site, perhaps? If so, one thing you could do to debug is to use the Device Mode Simulator of Chrome DevTools and emulate an Android device, which should be enough to trigger your mobile URL schemes. That might make it easier to debug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants