You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cdn/cdn-caching-rules.md
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: Control Azure Content Delivery Network caching behavior with caching rules | Microsoft Docs
3
-
description: 'You can use CDN caching rules to set or modify default cache expiration behavior both globally and with conditions, such as a URL path and file extensions.'
2
+
title: Control Azure CDN caching behavior with caching rules | Microsoft Docs
3
+
description: You can use CDN caching rules to set or modify default cache expiration behavior both globally and with conditions, such as a URL path and file extensions.
4
4
services: cdn
5
5
documentationcenter: ''
6
6
author: dksimpson
@@ -18,7 +18,7 @@ ms.author: v-deasim
18
18
19
19
---
20
20
21
-
# Control Azure Content Delivery Network caching behavior with caching rules
21
+
# Control Azure CDNk caching behavior with caching rules
22
22
23
23
> [!NOTE]
24
24
> Caching rules are available only for **Azure CDN from Verizon Standard** and **Azure CDN from Akamai Standard**. For **Azure CDN from Verizon Premium**, you can use the [Azure CDN rules engine](cdn-rules-engine.md) in the **Manage** portal for similar functionality.
@@ -38,11 +38,11 @@ For information about default caching behavior and caching directive headers, se
38
38
How to set CDN caching rules:
39
39
40
40
1. Open the Azure portal, select a CDN profile, then select an endpoint.
41
-
2. In the left pane under Settings, click**Caching rules**.
41
+
2. In the left pane under Settings, select**Caching rules**.
> Files that are cached before a rule change maintain their origin cache duration setting. To reset their cache durations, you must [purge the file](cdn-purge-endpoint.md). For **Azure CDN from Verizon** endpoints, it can take up to 90 minutes for caching rules to take effect.
Copy file name to clipboardExpand all lines: articles/cdn/cdn-dynamic-site-acceleration.md
+18-5Lines changed: 18 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Dynamic site acceleration via Azure CDN
3
-
description: Dynamic site acceleration deep dive
3
+
description: Azure CDN supports dynamic site acceleration (DSA) optimization for files with dynamic content.
4
4
services: cdn
5
5
documentationcenter: ''
6
6
author: dksimpson
@@ -148,19 +148,32 @@ With DSA, caching is turned off by default on the CDN, even when the origin incl
148
148
149
149
If you have a website with a mix of static and dynamic assets, it is best to take a hybrid approach to get the best performance.
150
150
151
-
For **Azure CDN from Verizon Premium** profiles, you can turn on caching for specific cases by using the [rules engine](cdn-rules-engine.md) for DSA endpoints. Any rules that are created affect only those endpoints of your profile that are optimized for DSA.
151
+
For **Azure CDN from Verizon Standard**and **Azure CDN from Akamai Standard**profiles, you can turn on caching for specific DSA endpoints by using [caching rules](cdn-caching-rules.md).
152
152
153
-
To access the rules engine for DSA endpoints:
153
+
To access caching rules:
154
+
155
+
1. From the **CDN profile** page, under settings, select **Caching rules**.
2. Create a global or custom caching rule to turn on caching for your DSA endpoint.
162
+
163
+
For **Azure CDN from Verizon Premium** profiles only, you turn on caching for specific DSA endpoints by using the [rules engine](cdn-rules-engine.md). Any rules that are created affect only those endpoints of your profile that are optimized for DSA.
164
+
165
+
To access the rules engine:
154
166
155
167
1. From the **CDN profile** page, select **Manage**.
2. From the CDN management portal, select **ADN**, then select **Rules Engine**.
162
174
163
-

175
+

176
+
164
177
165
178
166
179
Alternatively, you can use two CDN endpoints: one endpoint optimized with DSA to deliver dynamic assets and another endpoint optimized with a static optimization type, such as general web delivery, to delivery cacheable assets. Modify your webpage URLs to link directly to the asset on the CDN endpoint you plan to use.
Copy file name to clipboardExpand all lines: articles/cdn/cdn-how-caching-works.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: How caching works | Microsoft Docs
3
-
description: 'Caching is the process of storing data locally so that future requests for that data can be accessed more quickly.'
3
+
description: Caching is the process of storing data locally so that future requests for that data can be accessed more quickly.
4
4
services: cdn
5
5
documentationcenter: ''
6
6
author: dksimpson
@@ -61,11 +61,11 @@ Two headers can be used to define cache freshness: `Cache-Control` and `Expires`
61
61
## Cache-directive headers
62
62
63
63
> [!IMPORTANT]
64
-
> By default, an Azure CDN endpoint that is optimized for DSA ignores cache-directive headers and bypasses caching. You can adjust how an Azure CDN endpoint treats these headers by using CDN caching rules to enable caching. For more information, see [Control Azure CDN caching behavior with caching rules](cdn-caching-rules.md).
64
+
> By default, an Azure CDN endpoint that is optimized for DSA ignores cache-directive headers and bypasses caching. For **Azure CDN from Verizon Standard** and **Azure CDN from Akamai Standard** profiles, you can adjust how an Azure CDN endpoint treats these headers by using [CDN caching rules](cdn-caching-rules.md) to enable caching. For **Azure CDN from Verizon** profiles only, you use the [rules engine](cdn-rules-engine.md) to enable caching.
65
65
66
66
Azure CDN supports the following HTTP cache-directive headers, which define cache duration and cache sharing:
67
67
68
-
`Cache-Control`
68
+
**Cache-Control:**
69
69
- Introduced in HTTP 1.1 to give web publishers more control over their content and to address the limitations of the `Expires` header.
70
70
- Overrides the `Expires` header, if both it and `Cache-Control` are defined.
71
71
- When used in a request header, `Cache-Control` is ignored by Azure CDN, by default.
@@ -76,37 +76,37 @@ Azure CDN supports the following HTTP cache-directive headers, which define cach
76
76
-`no-cache`: Cache the content, but validate the content every time before delivering it from the cache. Equivalent to `Cache-Control: max-age=0`.
77
77
-`no-store`: Never cache the content. Remove content if it has been previously stored.
78
78
79
-
`Expires`
79
+
**Expires:**
80
80
- Legacy header introduced in HTTP 1.0; supported for backwards compatibility.
81
81
- Uses a date-based expiration time with second precision.
82
82
- Similar to `Cache-Control: max-age`.
83
83
- Used when `Cache-Control` doesn't exist.
84
84
85
-
`Pragma`
85
+
**Pragma:**
86
86
- Not honored by Azure CDN, by default.
87
87
- Legacy header introduced in HTTP 1.0; supported for backwards compatibility.
88
88
- Used as a client request header with the following directive: `no-cache`. This directive instructs the server to deliver a fresh version of the resource.
89
89
-`Pragma: no-cache` is equivalent to `Cache-Control: no-cache`.
90
90
91
91
## Validators
92
92
93
-
When the cache is stale, HTTP cache validators are used to compare the cached version of a file with the version on the origin server. **Azure CDN from Verizon** supports both ETag and Last-Modified validators by default, while **Azure CDN from Akamai** supports only Last-Modified by default.
93
+
When the cache is stale, HTTP cache validators are used to compare the cached version of a file with the version on the origin server. **Azure CDN from Verizon** supports both `ETag` and `Last-Modified` validators by default, while **Azure CDN from Akamai** supports only `Last-Modified` by default.
94
94
95
-
`ETag`
95
+
**ETag:**
96
96
-**Azure CDN from Verizon** uses `ETag` by default while **Azure CDN from Akamai** does not.
97
97
-`ETag` defines a string that is unique for every file and version of a file. For example, `ETag: "17f0ddd99ed5bbe4edffdd6496d7131f"`.
98
98
- Introduced in HTTP 1.1 and is more current than `Last-Modified`. Useful when the last modified date is difficult to determine.
99
99
- Supports both strong validation and weak validation; however, Azure CDN supports only strong validation. For strong validation, the two resource representations must be byte-for-byte identical.
100
100
- A cache validates a file that uses `ETag` by sending an `If-None-Match` header with one or more `ETag` validators in the request. For example, `If-None-Match: "17f0ddd99ed5bbe4edffdd6496d7131f"`. If the server’s version matches an `ETag` validator on the list, it sends status code 304 (Not Modified) in its response. If the version is different, the server responds with status code 200 (OK) and the updated resource.
101
101
102
-
`Last-Modified`
103
-
- For **Azure CDN from Verizon only**, Last-Modified is used if ETag is not part of the HTTP response.
102
+
**Last-Modified:**
103
+
- For **Azure CDN from Verizon only**, `Last-Modified` is used if `ETag` is not part of the HTTP response.
104
104
- Specifies the date and time that the origin server has determined the resource was last modified. For example, `Last-Modified: Thu, 19 Oct 2017 09:28:00 GMT`.
105
105
- A cache validates a file using `Last-Modified` by sending an `If-Modified-Since` header with a date and time in the request. The origin server compares that date with the `Last-Modified` header of the latest resource. If the resource has not been modified since the specified time, the server returns status code 304 (Not Modified) in its response. If the resource has been modified, the server returns status code 200 (OK) and the updated resource.
106
106
107
107
## Determining which files can be cached
108
108
109
-
Not all resources can be cached. The following table shows what resources can be cached, based on the type of HTTP response. Resources delivered with HTTP responses that don't meet all of these conditions cannot be cached. For **Azure CDN from Verizon Premium** only, you can use the Rules Engine to customize some of these conditions.
109
+
Not all resources can be cached. The following table shows what resources can be cached, based on the type of HTTP response. Resources delivered with HTTP responses that don't meet all of these conditions cannot be cached. For **Azure CDN from Verizon Premium** only, you can use the rules engine to customize some of these conditions.
110
110
111
111
|| Azure CDN from Verizon | Azure CDN from Akamai |
0 commit comments