1

I have a scenario where there is a necessity that the users reload the vuejs app to get the latest vue app version when i update the whole application in the server including the backend APIs.

Suppose there is a chance that a user using the vue app version 1.1 already on production, will still be continuing to use the same even after the update at server (ie to 1.2). In such cases the backend APIs might have changed and it would break.

Any short and easy ways/methods to solve the above?

Husni Abdul Nazer
  • 103
  • 1
  • 1
  • 12
  • 2
    pub/sub with web sockets, or long poll with ajax to determine version mismatch, then update accordingly. – Ohgodwhy Nov 26 '18 at 18:17
  • You can number your api endpoint: http:/yourapi/v1.1/customers and so on, when you update the api _old_ client can be redirect to the home with specific route – Max Oct 15 '19 at 17:17

1 Answers1

1

One way is to send the version number 1.1 or 1.2 in all our API requests to the backend. Then you check the version in the backend and send a special error if it is an old version. In the frontend you handle this special error by refreshing the page. Also make sure that your new *.js files have a new name so the client browser will fetch the new version and not load any cached *.js files.

Jens
  • 1,599
  • 14
  • 33