Search code examples
imagevue.jsgoogle-cloud-platformgoogle-compute-engine

How to fetch newly added images from VM in google cloud platform?


When I add images it is stored inside google cloud platform VM correctly. But I am not able to fetch newly added images in my website. If I redeploy project with newly added images in assets folder it is showing correctly. I have verified there is no mistake on frontend or backend side.

Is it not possible to get live image update with VM?

Edit:

I have used Vue.js.

I am storing images inside src/assets folder. When I save images in my website it is saved at src/assets folder.

I think it can only access things in dist folder after build. Can you suggest where should I save my file?


Solution

  • I'm making an educateg guess it's some cache issue.

    Instead of putting your image files inside the VM you can try storing them in a bucket that's accessible to public. The downside is that it can serve only static files (no PHP or anything).

    You have to configure your load balancer to forward all your.domain.com/images/ requests to the bucket but that's actually quite easy. Have a look at my answer asking for such configuration.