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?

2
  • 2
    pub/sub with web sockets, or long poll with ajax to determine version mismatch, then update accordingly. Commented Nov 26, 2018 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 Commented Oct 15, 2019 at 17:17

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.