3 ms·
If you really want to do it: 1) Store the result of Date.now() somewhere when the app starts 2) Have an interval to check the difference between Date.now() an
by janesconference 9y ago
If you really want to do it:
1) Store the result of Date.now() somewhere when the app starts
2) Have an interval to check the difference between Date.now() and the timestamp you stored in 1)
3) If the difference is over a certain threshold, force a page reload
(or schedule a page reload for when the user is in a "safe" state)
Or you could probably poll an endpoint / listen to a websocket and trigger the reloading by flipping a switch or sending a message. It won't be a client-only solution, though.
- crookie 9y agoThanks for the reply, I appreciate it . Will update with what approach i took. I am most probably going to use the webpack hash to do the check .