-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Website keeps reloading after installing PWA #166
Comments
@martinovmejl Do you notice it reload after logging in or logging out, for example? The reason for this is the service worker changes based on the authenticated user, and the default behavior is for the page to reload when the service worker updates: You can prevent this behavior by adding this to a custom plugin or theme: add_filter( 'wp_service_worker_skip_waiting', '__return_false' ); When you do this, an update button will be displayed in the admin bar if present: Honestly, I'm not totally satisfied with how the plugin handles the update scenario. The reload behavior is annoying, but the admin bar is not always displayed and there is no standard place to put the update button otherwise. The best third way would be to incorporate this button in your theme: |
Works, thanks! |
This has also been reported in #202, where two separate service workers were being installed. Can you check if the situation is similar? |
I've opened a PR to fix this and have a build for testing: #279 (comment). |
After installing PWA my website keeps on reloading in some cases.
I'm using OneSignal but is currently deactivated.
I also just installed Autoptimize & autoptimize criticalCSS and converted all images to WebP. But I think this isn't an issue.
The text was updated successfully, but these errors were encountered: