pan class="op">;</span></span></code></pre></div>
<p>To sum up, this service worker redirects the end user to the offline cached page (<code>offline.html</code>) whenever the app is offline, thereby offering a better user experience. The full code is located <a href="https://github.com/DivadNojnarg/outstanding-shiny-ui-code/blob/5bc49eab9496696a06da3f62d6aaf8ef468cdad4/inst/shinyMobile/pwa/www/service-worker.js">here</a>.</p>
<div class="importantblock">
<p>We strongly advise keeping the same file names.</p