2

When I navigate to my Azure static web app using Chrome I'm suddenly seeing an old version from months ago. It seems that several others have had this issue over the years (e.g. here), but I couldn't find any definitive solution anywhere.

Things I've tried:

  1. Disabling cache in 'Developer Tools' on Chrome then right-clicking on the refresh button and selecting 'Empty cache and hard reload'. This lets me see the latest (correct) version of the site ... but once I navigate away and return I get the old version again.
  2. Using Chrome incognito mode. This gets me the latest (correct) version of the site.
  3. Using my phone, or using another non-Chrome browser also gets me the latest (correct) version of the site.
  4. Unsetting my custom domain as the default for the site (under Settings > Custom domains) then navigating to the site's azurestaticapps.net address gets me the latest (correct) version of the site.

It seems that some sort of caching is going on when using my custom domain, but I can't seem to fix it. Interestingly, the version of the site that I'm seeing was a version from months ago when I last used that custom domain. Back then I'd linked the custom domain to a different version of the static web app launched under a different azurestaticapps name.

stoicalpirate
  • 250
  • 3
  • 12
  • What are the cache control headers sent in your initial page response? – Anand Sowmithiran Apr 22 '22 at 04:04
  • Did you check [this](https://stackoverflow.com/questions/54200310/controlling-cache-in-azure-static-web-site) out ? – Anand Sowmithiran Apr 22 '22 at 06:02
  • Thanks @AnandSowmithiran my understanding was that the question you linked to related to an older version of Azure Static Web Apps that was an extension of Azure Storage. Chrome DevTools currently shows `cache-control: max-age=0` – stoicalpirate Apr 22 '22 at 10:03

0 Answers0