<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Application on Nathaniel Inman</title><link>https://nathanielinman.com/tags/application/</link><description>Recent content in Application on Nathaniel Inman</description><generator>Hugo -- 0.147.7</generator><language>en-us</language><copyright>Nathaniel Inman</copyright><lastBuildDate>Tue, 11 Jul 2017 00:00:00 +0000</lastBuildDate><atom:link href="https://nathanielinman.com/tags/application/index.xml" rel="self" type="application/rss+xml"/><item><title>Updating a SPA automatically without browser refresh</title><link>https://nathanielinman.com/updating-a-spa-automatically-without-browser-refresh/</link><pubDate>Tue, 11 Jul 2017 00:00:00 +0000</pubDate><guid>https://nathanielinman.com/updating-a-spa-automatically-without-browser-refresh/</guid><description>&lt;p>I was asked a very interesting interview question today.&lt;/p>
&lt;blockquote>
&lt;p>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.&lt;/p>&lt;/blockquote>
&lt;p>The first problem to figure out is how do I know the application was updated?&lt;/p>
&lt;ol>
&lt;li>Polling the entry bundle asset&lt;/li>
&lt;li>Polling the Index.html and comparing hashes/versions&lt;/li>
&lt;li>Polling some custom tiny server text doc&lt;/li>
&lt;li>Dashboard websocket contains the version&lt;/li>
&lt;li>On acquisition of new data it contains version&lt;/li>
&lt;li>We don&amp;rsquo;t update until a change of route&lt;/li>
&lt;/ol>
&lt;p>Now we have a version, we distinguish that the server version is &amp;lsquo;greater&amp;rsquo; than ours. How do we acquire the new asset?&lt;/p></description></item></channel></rss>