You are configuring caching rules for an Azure CDN Standard from Microsoft endpoint that delivers content for a web application. The application has the following requirements:
- The homepage (/index.html) must cache promotional landing pages differently based on the query string parameters (e.g., ?promo=summer vs ?promo=winter).
- Rest API endpoints under the path /api/ must never be cached by the CDN, regardless of any caching headers returned by the origin server.
Which two configurations should you apply to meet these requirements?
- Configure the global query string caching behavior to Cache every unique URL.Cevap
- Create a custom caching rule with a match path of /api/* and set the caching behavior to Bypass cache.Cevap
- CConfigure the global query string caching behavior to Bypass caching.
- DCreate a custom caching rule with a match path of /api/* and set the caching behavior to Set if missing.
Cevap
Configure the global query string caching behavior to Cache every unique URL, and create a custom caching rule with a match path of /api/* and set the caching behavior to Bypass cache.
Configuring the global query string caching behavior to 'Cache every unique URL' ensures that each unique promotional query string serves a cached page specific to that parameter. Creating a custom caching rule for the path /api/* with the caching behavior 'Bypass cache' ensures that API endpoints are never cached by the CDN, ignoring any cache-control headers from the origin server.
Adım Adım Çözüm
Anahtar Kavram
Azure CDN caching rules allow customizing how files are cached based on file paths, file extensions, and query string parameters. Custom caching rules can override or bypass origin cache-control headers, and query string caching behavior determines how the CDN caches unique URLs containing query strings.