DEV Community


Discussion: What is the best way to get users to refresh a web app?

marcellothearcane profile image marcellothearcane ・1 min read

I'm currently developing a Nuxt web app for our staff to use for processing orders.

At the moment, there are a lot of bugs being fixed or new features implemented.

The trouble is, the users generally keep the tab open for days on end, since they are using it constantly - and since it's Nuxt, they don't ever hard-refresh.

This means they don't get the bug fixes they asked for as soon as they have been deployed.

What is the simplest notification system for me to quickly post a 'Refresh this page to see the latest version' popup?

I'm using Nuxt, GraphQL, and Zeit deployment, so if it could trigger from a successful deploy on Zeit that would be awesome.


Editor guide
sergiodxa profile image
Sergio Daniel Xalambrí

What Next does and probably Nuxt can do if it’s not default is create a BUILD_ID, if such ID changed when the user tried to access another page then it’s hard reloaded. Maybe you could do something similar?

tobiassn profile image
Tobias SN

Once every 5 minutes or something, the client should request the newest version number from the server. If it’s different from the one it’s currently running, it should show a popup in the corner telling the user that there’s a new version and that they should refresh.

skryking profile image
Jason Ormes

Do something to cause their browser to crash...

marcellothearcane profile image
marcellothearcane Author

Hah. It does that already - these are the bug fixes!

brettm12345 profile image
Brett Mandler

You could create an event listener to trigger a popup when a service worker finds an update. Take a look at