Skip to content

Commit db1d663

Browse files
author
Fernando Antivero
authored
set CacheControl max-age for fingerprinted resources at CDN level + DSA (#58)
* set CacheControl max-age at CDN level for fingerprinted resources solved: #115258 * configure DSA
1 parent e1f1619 commit db1d663

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/ClientApp/readme.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ export CDN_ENDPOINT_HOST=$(az cdn endpoint create --location $LOCATION --resourc
6464
--no-http --origin $WEB_SITE_HOST --origin-host-header $WEB_SITE_HOST \
6565
--query hostName --output tsv)
6666

67+
# Configure custom caching rules
68+
az cdn endpoint update \
69+
-g $RESOURCEGROUP \
70+
--profile-name $CDN_NAME \
71+
-n $CDN_NAME \
72+
--set deliveryPolicy.description="" \
73+
--set deliveryPolicy.rules='[{"actions": [{"name": "CacheExpiration","parameters": {"cacheBehavior": "Override","cacheDuration": "366.00:00:00"}}],"conditions": [{"name": "UrlFileExtension","parameters": {"extensions": ["js","css","map"]}}],"order": 1}]'
74+
6775
export CLIENT_URL="https://$CDN_ENDPOINT_HOST"
6876
```
6977

@@ -161,6 +169,17 @@ export COMMIT_SHA1=$(git rev-parse HEAD) && \
161169
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
162170
```
163171

172+
## Configure Dynamic Site Acceleration
173+
174+
```bash
175+
az cdn endpoint update \
176+
-g $RESOURCEGROUP \
177+
--profile-name $CDN_NAME \
178+
-n $CDN_NAME \
179+
--set optimizationType="DynamicSiteAcceleration" \
180+
--set probePath="/semver.txt"
181+
```
182+
164183
## Update the reply URL for the registered application
165184

166185
> 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.

0 commit comments

Comments
 (0)