You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.
i have web app with header,footer and content.. my content is similar to app-shell. and i am using page.js for client side routing.. so when user requests page xxx.com/app/example1 .. i load example1.html via jquery.load(..) and so on.. my sw-precache file looks like this.. function writeServiceWorkerFile(cachename,rootDir, handleFetch, callback) { var config = { cacheId: cachename, staticFileGlobs: [ rootDir + '/assets/min/css/**/*.css', //rootDir + '/assets/min/js/lib/**/*.css', rootDir + '/**.html', rootDir + '/assets/images/**.*', rootDir + '/assets/font/**.*', rootDir + '/assets/min/js/**/*.js' ], stripPrefix: rootDir + '/', verbose: false, runtimeCaching:[{ urlPattern:/\/app\//, handler: 'cacheFirst' }], //navigateFallback: 'index.html', navigateFallbackWhitelist: [/^\/app/] }; swPrecache.write(path.join(rootDir, 'service-worker.js'), config, callback) }
when i see the page.. it loads example1.html from service worker cache.. which works fine..
my example1.html looks like
css files in example1.html gets loaded from cache.. but javascript files which are included in example1.html dont get loaded from cache.. how can i make sure they gets loaded from cache as well.. when i see service-worker under developer console --> application --> cache storage.. i see all above 3 js files are there..
i dont know what am i missing here.. do i need to set up custom-handler.js and use that ??
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
i have web app with header,footer and content.. my content is similar to app-shell. and i am using page.js for client side routing.. so when user requests page xxx.com/app/example1 .. i load example1.html via jquery.load(..) and so on.. my sw-precache file looks like this..
function writeServiceWorkerFile(cachename,rootDir, handleFetch, callback) { var config = { cacheId: cachename, staticFileGlobs: [ rootDir + '/assets/min/css/**/*.css', //rootDir + '/assets/min/js/lib/**/*.css', rootDir + '/**.html', rootDir + '/assets/images/**.*', rootDir + '/assets/font/**.*', rootDir + '/assets/min/js/**/*.js' ], stripPrefix: rootDir + '/', verbose: false, runtimeCaching:[{ urlPattern:/\/app\//, handler: 'cacheFirst' }], //navigateFallback: 'index.html', navigateFallbackWhitelist: [/^\/app/] }; swPrecache.write(path.join(rootDir, 'service-worker.js'), config, callback) }
when i see the page.. it loads example1.html from service worker cache.. which works fine..
my example1.html looks like
css files in example1.html gets loaded from cache.. but javascript files which are included in example1.html dont get loaded from cache.. how can i make sure they gets loaded from cache as well.. when i see service-worker under developer console --> application --> cache storage.. i see all above 3 js files are there..
i dont know what am i missing here.. do i need to set up custom-handler.js and use that ??
The text was updated successfully, but these errors were encountered: