[Vuejs]-When I update the image of a server object on the back-end, the front-end doesn't render the new image because it has the same URL as the previous one

1👍

The browser caches your image for you based on the URL.

You could add a timestamp to the last part of the URL of the image (for example with a data variable in Vue)

http://localhost:3000/images/servers/Test-0dbc1792-2e99-4abf-acd3-b35ede0bef9e/ef026092-ced8-4458-b7c7-5a4131dfcde7.png?timestamp=32132131231

Update this value when the backend is done updating the images, or refresh this variable every x seconds if you don’t know exactly when the backend is done updating.

Leave a comment