Azure App Service doesnt update the UI after pushing the latest docker image

Siddhesh Sreedar 45 Reputation points
2024-07-13T17:04:44.7666667+00:00

Hi, so I made just a simple HTML change to my code i.e replace an image. The image is currently placed in the directory and I checked locally and the changes show up.

I then pushed it to my GitHub repo which automatically starts the deployment pipeline which builds a docker image and that ran successfully. When I then looked at the docker hub, I could see the latest push.

But then when I refresh my Azure app which is connected to this docker image, the changes don't show up. I tried restarting the app, and still no changes.

I then pull this docker image locally to see and I can see the changes locally. So there is nothing wrong with the docker image since I can see the changes locally but for some reason, the Azure app is not updating to show the latest UI changes.

Any reason for this? Does Azure take time to show the latest changes or something? Im confused

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,408 questions
{count} votes

Accepted answer
  1. brtrach-MSFT 15,866 Reputation points Microsoft Employee
    2024-07-22T04:11:25.23+00:00

    @Siddhesh Sreedar To build upon what Lex shared, I agree that this sounds like a browser cache issue.

    You can try adding a cache-busting query parameter to the URL of the changed image file. This will force the browser to download the new image instead of using the cached one.

    For example, if your image file is named "image.jpg", you can change the URL to "image.jpg?v=2" or "image.jpg?version=2". This will make the browser think that it's a new file and download it again.

    If this doesn't work, you can try setting the cache-control header in your web server configuration. You can set it to "no-cache" or "max-age=0" to force the browser to always request the latest version of the file. (This would be less ideal as it could slow the experience for users of your site as page load times might increase and depending on the amount of traffic on your site, your Web App could see more resource consumption resulting in needing additional instances to handle the workload.)

    You can set the cache-control header in your Flask app by adding the following line to your app.py file:

    from
    

    This will set the cache timeout to 0 for all files in the "images" directory. You can adjust the directory and cache timeout as needed.

    0 comments No comments

0 additional answers

Sort by: Most helpful