Enforce reload of the frontend after the deployment of a new release
If the frontend javascript code in a new release is changed a client should always use this new code to avoid bugs and/or broken functionality.
Our frontend framework, Vue is a single-page-application framework. There for after initially receiving the frontend javascript code a client subsequently only executes API calls and does not reload the javascript code. This leads to clients using old javascript code after a deployment until they reload the entire page.
A possible solution could be:
- Every API request (or only pings) carries information on the frontend version (commit SHA as used in many places)
- The client compares this with the version it's code has.
- If a version mismatch occurs the client should trigger a page reload
We should evaluate if and when this could cause data loss (i.e. a user is currently entering data into a field) if this is possible it might be a better idea to offer a hint ("reload now / later") for the user to trigger?
Edited by Michael Prilop