Skip to content

Reload page on updated hook (new files cached) #2589

@frederikhors

Description

@frederikhors

Version 3.0.3

I'm using the default file in a cli-vue 3 new app. What I need is to reload a page when service worker detects and updates new files.

Using your default hook I tried to use this code:

console.log('New content is available; please refresh.')     
window.location.reload()   },

It works but it reloads forever!

Why?

I read a lot about Google Workbox and @vue/cli-plugin-pwa and I know these default hooks are bundled in final .js and executed on the main thread. So I think maybe I'm wrong? I used create-react-app default service-worker.js and the reload used to work.

Where am I wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproductionThis issue is missing a minimal runnable reproduction, provided by the authorscope: pwa

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions