1

I have a single page web app that is build with a version number, I also have RESTful API call that says what version of Web App is being served statically. This allows the Web App to determine when it is not at the latest version.

I am looking for a way to take action on this information and force the browser to reload the web app. Any additional information about how to query the browser cache and selectively update would also be appreciated.

Liam Kelly
  • 2,826
  • 1
  • 14
  • 25
  • Possibly use a global JS variable for the version number. Compare that with the version number from the RESTful API to determine if the cache is out-of-date. You will need to request the user to clear their cache or reload the page with meta data to try to force the cache to refresh. – daddygames Oct 09 '18 at 16:10
  • That is what i am doing now for version change detection. After I detect the change, I need to force a reload without asking the user to do it manually. The reason for this is an F5 may not work and 'harder' cache clearing techniques make users nervous. – Liam Kelly Oct 09 '18 at 16:32
  • There are a few things you can do to refresh the cache. See https://stackoverflow.com/questions/32414/how-can-i-force-clients-to-refresh-javascript-files – daddygames Oct 09 '18 at 20:01

0 Answers0