0
0
Azurecloud~30 mins

CDN caching rules in Azure - Mini Project: Build & Apply

Choose your learning style9 modes available
Azure CDN Caching Rules Setup
📖 Scenario: You are managing a website hosted on Azure. To improve performance, you want to set up caching rules on Azure CDN to control how content is cached and served to users.
🎯 Goal: Build an Azure CDN caching rules configuration that sets caching behavior for specific file types and paths.
📋 What You'll Learn
Create a dictionary called cdn_endpoints with one endpoint named mycdnendpoint and its origin URL
Add a variable called cache_duration_seconds set to 3600
Create a list called caching_rules with a rule that caches .jpg and .png files for the duration in cache_duration_seconds
Add a final configuration dictionary called cdn_config that includes the endpoint and caching rules
💡 Why This Matters
🌍 Real World
Setting caching rules on Azure CDN helps speed up website loading by storing static content closer to users, reducing server load and bandwidth.
💼 Career
Cloud engineers and DevOps professionals often configure CDN caching to optimize application performance and cost.
Progress0 / 4 steps
1
Create the CDN endpoint dictionary
Create a dictionary called cdn_endpoints with one key 'mycdnendpoint' and its value set to 'https://myorigin.azurewebsites.net'.
Azure
Need a hint?

Use curly braces to create a dictionary with the exact key and value.

2
Add cache duration variable
Add a variable called cache_duration_seconds and set it to 3600.
Azure
Need a hint?

Set the variable to the number of seconds for caching.

3
Create caching rules list
Create a list called caching_rules with one dictionary inside. The dictionary must have keys 'name' with value 'imageCaching', 'file_extensions' with value ['.jpg', '.png'], and 'cache_duration' set to the variable cache_duration_seconds.
Azure
Need a hint?

Use a list with one dictionary containing the specified keys and values.

4
Combine into final CDN configuration
Create a dictionary called cdn_config with keys 'endpoint' set to cdn_endpoints['mycdnendpoint'] and 'caching_rules' set to the caching_rules list.
Azure
Need a hint?

Use a dictionary with the specified keys and values referencing previous variables.