Set up third-party CDNs for MediaTailor ad delivery
Third-party CDNs like Akamai and Fastly can significantly improve the performance and scalability of your AWS Elemental MediaTailor ad delivery while reducing bandwidth costs. However, CDN configuration for personalized advertising requires specific settings that differ from standard video delivery.
This guide walks you through the complete process of setting up your third-party CDN to work optimally with MediaTailor. You'll learn how to configure two essential behaviors:
-
Manifest bypass: Ensures each viewer receives personalized ad insertions by preventing manifest caching
-
Segment caching: Maximizes performance and reduces costs by efficiently caching video content
The configuration process typically takes 30-60 minutes and includes provider selection, setup, verification, and optimization. Once complete, you'll have a CDN configuration that delivers personalized ads efficiently while maintaining optimal viewer experience.
Note
This guide focuses on Akamai and Fastly configurations. For CloudFront setup instructions, see CloudFront integration.
Prerequisites
Before setting up your third-party CDN with MediaTailor, make sure you have:
-
An active MediaTailor configuration that includes your content origin and ad decision server
-
Access to your CDN's configuration interface
-
A list of file extensions used in your content (.m3u8, .mpd, .ts, and so on)
-
Your CDN provider's documentation for reference
For CloudFront setup instructions instead of third-party CDNs, see CloudFront integration.
Terminology
To understand CDN configuration requirements, you need to know these manifest types:
-
HLS manifests:
-
Multivariant playlist: The top-level manifest that contains links to media playlists
-
Media playlist: The second-level manifest with links to content segments
-
-
DASH manifests:
-
MPD (Media Presentation Description): The standard term for DASH manifests
-
This guide refers to all manifest files (multivariant playlists, media playlists, and MPDs) collectively as manifests when discussing common configuration requirements.
For general CDN configuration principles that apply to all providers, see Set up CDN integration with MediaTailor.
For CDN optimization guidance, see Performance optimization guide for CDN and MediaTailor integrations.
Configure CDN caching rules
CDN caching configuration is critical for MediaTailor ad delivery because it determines how your content reaches viewers. Proper configuration ensures that manifests remain personalized for each viewer while segments are efficiently cached to reduce origin load and improve performance.
This configuration typically takes 15-30 minutes per CDN provider and requires two distinct behaviors:
-
Manifest handling: Prevents caching to ensure each viewer receives personalized ad insertions
-
Segment caching: Maximizes cache efficiency for video content to improve delivery performance
Follow these steps to configure your CDN's caching rules for optimal ad delivery.
Choose your CDN provider from the following tabs for specific instructions:
Verify your CDN configuration
Verification ensures that your CDN configuration works correctly before you direct production traffic through it. These tests confirm that ad personalization functions properly and that caching provides the expected performance benefits.
Complete verification typically takes 10-15 minutes and should be performed from multiple geographic locations if possible.
After setting up your CDN, perform these checks to verify it's working correctly:
-
Test manifest personalization:
-
Request the same content URL with different ad parameters
-
Verify that each request returns different ad insertions
-
-
Test segment caching:
-
Check CDN metrics for segment cache hit ratio (should be greater than 90%)
-
Monitor origin traffic to confirm it's lower than direct delivery
-
-
Test playback performance:
-
Play content through your CDN from different locations
-
Verify smooth playback with no buffering issues
-
For comprehensive testing methodologies and advanced validation procedures, see Testing and validation for CDN and MediaTailor integrations.
Optimize CDN performance
After verifying your basic configuration, implement these optimizations to maximize performance and minimize costs:
Monitor key performance metrics
Track these metrics to ensure optimal performance:
- Cache hit ratio
-
Target: Greater than 90% for video segments
Impact: Higher ratios reduce origin load and improve viewer experience
Monitor: Check your CDN provider's analytics dashboard daily
- Origin response time
-
Target: Less than 200ms for manifest requests
Impact: Faster manifest delivery reduces startup time for viewers
Monitor: Set up alerts for response times exceeding 500ms
- Error rates
-
Target: Less than 0.1% for all requests
Impact: High error rates indicate configuration issues or origin problems
Monitor: Set up alerts for error rates exceeding 1%
Fine-tune caching behavior
Adjust these settings based on your content characteristics and viewer patterns:
- Segment TTL optimization
-
Live content: Use shorter TTL (1-4 hours) to ensure timely updates
VOD content: Use longer TTL (24-48 hours) to maximize cache efficiency
Ad segments: Consider shorter TTL (30 minutes to 2 hours) for frequently updated ad content
For comprehensive TTL recommendations and caching strategies across all MediaTailor workflows, see Caching optimization for CDN and MediaTailor integrations.
- Geographic optimization
-
Multi-region origins: Configure origin selection based on viewer location
Edge locations: Enable additional edge locations in regions with high viewer concentration
Failover: Configure backup origins for high availability
Optimize costs
Implement these strategies to reduce CDN costs while maintaining performance:
-
Compression: Enable gzip compression for manifest files to reduce bandwidth usage
-
Purging strategy: Implement selective cache purging instead of full cache clears
-
Traffic analysis: Review traffic patterns monthly to identify optimization opportunities
-
Tier selection: Use appropriate CDN service tiers based on your performance requirements
Troubleshoot third-party CDN issues
CDN configuration issues typically manifest as either ad personalization problems or performance degradation. Use this systematic approach to identify and resolve the most common issues that affect MediaTailor ad delivery.
Most troubleshooting can be completed within 15-30 minutes by checking the specific symptoms and applying the corresponding solutions.
If viewers experience problems with ad delivery or playback quality, use this guide to identify and resolve common CDN configuration issues:
- Akamai: Cached manifests
-
Symptom: Viewers see identical ads even when you configure different targeting parameters.
Solution: Verify that you applied the No Store caching option to manifest paths.
Also verify that you included query parameters in the cache key.
- Fastly: Incorrect cache keys
-
Symptom: Viewers experience inconsistent ad personalization.
Viewers might also see ads intended for other viewers.
Solution: Verify that you configured the Forward settings to include all query parameters in the cache key.
- General: High origin traffic
-
Symptom: Your origin servers experience unexpectedly high traffic
Solution: Verify segment caching settings and time-to-live (TTL) values.
Check cache hit ratios in your CDN metrics.
- General: Playback errors
-
Symptom: Viewers experience buffering or playback failures
Solution: Check CDN routing rules and origin health.
Verify that all required headers are being forwarded correctly.
Note
If these solutions don't resolve your issue, check your CDN provider's documentation. You can also contact their support team for additional troubleshooting steps.
For general CDN troubleshooting guidance, see Troubleshoot issues with MediaTailor and CDN integration.