Updating a SPA automatically without browser refresh

I was asked a very interesting interview question today. Lets assume you have a single page application running on n users computers as a dashboard and you updated the application, how does all of the clients receive and manage the updated assets without incurring a browser refresh. The first problem to figure out is how do I know the application was updated? Polling the entry bundle asset Polling the Index.html and comparing hashes/versions Polling some custom tiny server text doc Dashboard websocket contains the version On acquisition of new data it contains version We don’t update until a change of route Now we have a version, we distinguish that the server version is ‘greater’ than ours. How do we acquire the new asset? ...

July 11, 2017 · 3 min