John Resig, founder of jQuery, recently raised a great discussion on how to handle Single Page Application reloading after deployment.
For folks that've developed Single Page Apps - how do you deal with users leaving pages open for a *really* long time? Reload every N days? Reload after a deploy? We frequently have users attempt actions many weeks after a feature was removed!
— John Resig (@jeresig) January 10, 2019
Some of the options included:
- Pass build version with each Ajax response and reload if mismatched.
- Send a version hash to a server and force 412 code if versions not matching.
- Notification on version update to leave refresh up to user to decide.
- Client version passed in HTTP header to check for updates.
- Log out all the clients at midnight
- Turning on the servers only from 9 till 5.