Skip to content

Commit

Permalink
set CacheControl max-age for fingerprinted resources at CDN level + D…
Browse files Browse the repository at this point in the history
…SA (#58)

* set CacheControl max-age at CDN level for fingerprinted resources

solved: #115258

* configure DSA
  • Loading branch information
Fernando Antivero authored Aug 30, 2019
1 parent e1f1619 commit db1d663
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/ClientApp/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ export CDN_ENDPOINT_HOST=$(az cdn endpoint create --location $LOCATION --resourc
--no-http --origin $WEB_SITE_HOST --origin-host-header $WEB_SITE_HOST \
--query hostName --output tsv)

# Configure custom caching rules
az cdn endpoint update \
-g $RESOURCEGROUP \
--profile-name $CDN_NAME \
-n $CDN_NAME \
--set deliveryPolicy.description="" \
--set deliveryPolicy.rules='[{"actions": [{"name": "CacheExpiration","parameters": {"cacheBehavior": "Override","cacheDuration": "366.00:00:00"}}],"conditions": [{"name": "UrlFileExtension","parameters": {"extensions": ["js","css","map"]}}],"order": 1}]'

export CLIENT_URL="https://$CDN_ENDPOINT_HOST"
```

Expand Down Expand Up @@ -161,6 +169,17 @@ export COMMIT_SHA1=$(git rev-parse HEAD) && \
until export PIPELINE_STATUS=$(az pipelines build list --project $AZURE_DEVOPS_PROJECT_NAME --query "[?sourceVersion=='${COMMIT_SHA1}']".status -o tsv 2> /dev/null) && [[ $PIPELINE_STATUS == "completed" ]]; do echo "Monitoring multi-stage pipeline: ${PIPELINE_STATUS}" && sleep 20; done
```

## Configure Dynamic Site Acceleration

```bash
az cdn endpoint update \
-g $RESOURCEGROUP \
--profile-name $CDN_NAME \
-n $CDN_NAME \
--set optimizationType="DynamicSiteAcceleration" \
--set probePath="/semver.txt"
```

## Update the reply URL for the registered application

> If you're using a tenant different to the tenant associated to the subscription, log in to that tenant. You will need to log in the subscription after creating the application to continue the instructions.
Expand Down

0 comments on commit db1d663

Please sign in to comment.