Static website has correct content but it's not reflected on the custom domain

Nathan 0 Reputation points
2025-10-08T05:34:49.33+00:00

Our CI/CD deploys successfully and we can see the changes in the xsitex.azurestaticapps.net immediately.

However, even when we have "Cache-Control": "no-cache" in the staticwebapp.json the content is not updating in the public facing www.xsitex.com

User's image

See network traffic inspection on the file it correctly states no-cache.
User's image

I've tried numerous approaches and see threads on this issue eg:
https://free.blessedness.top/en-us/answers/questions/1474652/static-web-app-caching-content
Forums seem to have many people with the same issue. There is no action in the azure dashboard for static websites to flush this cache so how can we fix this independently without support?

I've paid for support but I cannot raise a ticket with the azure team.

How can we get the azure team to flush the cache?

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
{count} votes

1 answer

Sort by: Most helpful
  1. Alex Burlachenko 18,310 Reputation points Volunteer Moderator
    2025-10-08T06:49:01.05+00:00

    Hi Nathan,

    what's happening is that Azure uses a CDN for custom domains that has its own caching layer separate from your staticwebapp.config rules. Even with "no-cache" headers, the edge nodes might be serving stale content.

    add a query string parameter to your URLs when testing. Something like ?v=2 or ?timestamp=123456789 can bypass the CDN cache for immediate verification that your new content is actually deployed.

    You can also try forcing a different cache behavior by modifying your staticwebapp.config. Instead of just "no-cache", try:

    { "headers": [ { "path": "**", "headers": [ { "name": "Cache-Control", "value": "no-cache, no-store, must-revalidate" } ] } ] }

    The Static Web Apps documentation mentions cache behavior for custom domains https://free.blessedness.top/en-us/azure/static-web-apps/configuration.

    Another workaround is to temporarily switch your custom domain to point directly to your .azurestaticapps.net URL instead of using the CDN endpoint. This isn't ideal for production, but it can confirm whether the issue is specifically with the CDN caching.

    If you need immediate resolution and have paid support, you should be able to create a support ticket through the Azure portal. Go to your Static Web App resource, then select "Help + support" in the left menu, and create a new support request. Choose "Technical" for issue type and "Static Web Apps" for the service.

    You can also try reaching out to the Azure Static Web Apps product team through their GitHub repository. They're often responsive to caching issues reported there.

    For future deployments, consider implementing cache-busting techniques in your build process, like adding content hashes to your filenames or using versioned directories

    regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    

    https://ctrlaltdel.blog/

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.