Question

Difficulty: HardConfigure and Manage Azure CDN Endpoints and Caching Rules

You are configuring an Azure CDN Standard from Microsoft endpoint for a web application. The application delivers dynamic user profile banners from the path `/assets/banners/`. The banners are updated periodically, and the application appends a query string containing a version token (for example, `/assets/banners/user1.png?v=982a` where `vv` represents the version token) to ensure updates are reflected immediately.

The origin server serves these banners with a `Cache-Control: public, max-age=600` header (representing a duration of `1010` minutes). You need to configure the CDN caching rules to meet the following requirements:
- Cache the banners on the CDN edge servers for `55` days.
- Ensure that users receive the correct version of the banner matching their version token query string.
- Optimize cache utilization by avoiding unnecessary calls to the origin server for cached banner versions.

Which configuration should you apply to the CDN endpoint?

  1. A
    Create a custom caching rule for the path `/assets/banners/*` with the caching behavior set to Override and duration set to 55 days. Set the query string caching behavior of the endpoint to Ignore query strings.
  2. Create a custom caching rule for the path `/assets/banners/*` with the caching behavior set to Override and duration set to 55 days. Set the query string caching behavior of the endpoint to Cache every unique URL.Answer
  3. C
    Create a custom caching rule for the path `/assets/banners/*` with the caching behavior set to Override and duration set to 55 days. Set the query string caching behavior of the endpoint to Bypass caching.
  4. D
    Create a custom caching rule for the path `/assets/banners/*` with the caching behavior set to Set if missing and duration set to 55 days. Set the query string caching behavior of the endpoint to Cache every unique URL.

Answer

Create a custom caching rule for the path `/assets/banners/*` with the caching behavior set to Override and duration set to 55 days. Set the query string caching behavior of the endpoint to Cache every unique URL.
The correct configuration uses the 'Override' caching behavior for the path `/assets/banners/*` with a duration of `55` days, which forces the CDN to ignore the origin's shorter `Cache-Control` header (10 minutes) and apply the `55-day` lifetime. Additionally, configuring the query string caching behavior to 'Cache every unique URL' ensures that each unique version token (e.g., `v=982av=982a`) causes the CDN to cache that specific variant of the banner, preventing stale banner delivery while still caching the files to reduce origin load.

Step-by-Step Solution

1
Select the correct caching behavior to handle the origin server's existing Cache-Control header.
Choose 'Override' caching behavior instead of 'Set if missing'.
Since the origin server sends a Cache-Control header (max-age=600600 seconds), using 'Set if missing' would respect the origin's 1010-minute cache duration. 'Override' is required to ignore the origin header and apply the desired 55-day duration.
2
Configure the path and duration for the caching rule.
Set the path to `/assets/banners/*` and the duration to `55` days.
This target matches the directory containing user banners and applies the required 55-day cache lifetime.
3
Determine the appropriate query string caching behavior for versioned assets.
Set the query string caching behavior of the endpoint to 'Cache every unique URL'.
Since the application uses a query string parameter to differentiate between banner versions, selecting 'Cache every unique URL' ensures that different versions of the same file are cached separately. 'Ignore query strings' would serve stale content, and 'Bypass caching' would prevent caching entirely.

Key Concept

Azure CDN caching rules and query string caching behaviors allow developers to control how files are cached at the edge. The 'Override' caching behavior replaces origin cache headers, while 'Cache every unique URL' is critical for caching dynamic or versioned assets that rely on query string parameters.
Estimated Time:2m 0s
Rate this question