2

I have written an SPA which caches all its assets like bundle-1234.js which are required in the index.html. I'm wondering that when the bundle-1234.js is downloaded, cached and executed how does the app ever refresh when the bundle changed to bundle-9876.js?

I'm using react-router-dom do the routing of my SPA, so a route change is not a page refresh. Beware that the app will not be manually refreshed by the user.

How do you tell a SPA to refesh its assets when the page doesn't refresh?

NealVDV
  • 2,302
  • 3
  • 26
  • 51
  • How and when are you changing the bundle.js? Assets to be updated should be referenced in your state or props. – mhatch Sep 01 '17 at 14:52
  • 1
    By uploading it to my server when I deploy an update, don't know how to be more specific. How would I check if the assets in my state are not matching the newly deployed assets? – NealVDV Sep 01 '17 at 14:54
  • If you are deploying an update to your server, why would a client app be continuously running? Why would there be no refresh or reload? – mhatch Sep 01 '17 at 15:00
  • If you are assuming a "forever-running" client app, why don't you just write in a timed refresh to the application to 'check if there are any changes' – mhatch Sep 01 '17 at 15:02
  • It is an app which runs on IOS / android devices in a kiosk and is locked to the screen. Updating this should not take an employee to run around and update all X amount of Ipads when an update happens :) – NealVDV Sep 01 '17 at 15:07
  • I would recommend writing in a timed refresh function to your app. You can decide what is a reasonable time interval to refresh the app. – mhatch Sep 01 '17 at 15:10

0 Answers0