Skip to content

Instantly share code, notes, and snippets.

@danparker276
Created October 8, 2020 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danparker276/5575b5d7307cae4e607497dc17046a00 to your computer and use it in GitHub Desktop.
Save danparker276/5575b5d7307cae4e607497dc17046a00 to your computer and use it in GitHub Desktop.
Powershell Add Cache-Control to Azure Storage Index.html for Static Website on JAM stack for example
#I run this on azure devops after I deploy my javascript app (react, vue...) to an azure storage website
#Make sure your index.html calls your compiled javascript file that has a unique or build name and you won't need
#your customers to have to hard refresh their browsers to get updates.
#Note this assumes a common Azure Static website deploy, I haven't found good docs on how to do this
az storage blob update --account-name <storageAccount> --account-key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxQ== --container-name "`$web" --name "index.html" --content-cache-control "max-age=100"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment