Caching optimization for CDN and MediaTailor integrations
AWS Elemental MediaTailor caching requirements vary by workflow type and content format. Proper caching configuration is critical for optimal performance, cost efficiency, and viewer experience. The following sections provide detailed caching guidance for different MediaTailor implementations.
Server-side ad insertion (SSAI) caching
For server-side ad insertion workflows, personalized manifests cannot be cached, but content and ad segments should be cached aggressively:
Content type | TTL | Path pattern | Cache key elements |
---|---|---|---|
Multivariant playlists | 0 seconds | /v1/master/* | URL path + all query parameters |
Media playlists | 0 seconds | /v1/manifest/* | URL path + all query parameters |
DASH MPDs | 0 seconds | /v1/dash/* | URL path + all query parameters |
Content segments | 24+ hours | Content-specific paths | URL path only |
Ad segments | 24+ hours | /v1/segment/* | URL path only |
-
Set TTL of 0 seconds for personalized manifests to ensure viewers receive up-to-date ad content
-
Configure longer TTL values for content and ad segments to maximize cache efficiency
-
Set up cache behaviors that include personalization parameters in the cache key if you support targeted advertising
-
Implement request collapsing at the CDN level to efficiently handle concurrent requests
Recommended TTL configuration settings
For optimal SSAI performance, configure your CDN cache policies with these specific TTL settings:
Content type | TTL setting | Recommended value |
---|---|---|
Ad segments | Min TTL | 1 second |
Ad segments | Max TTL | 86400 seconds (24 hours) |
Ad segments | Default TTL | 86400 seconds (24 hours) |
Content segments | Min TTL | 1 second |
Content segments | Max TTL | 86400 seconds (24 hours) |
Content segments | Default TTL | 86400 seconds (24 hours) |
These settings ensure:
-
Min TTL of 1 second: Allows for rapid cache invalidation when needed while preventing excessive origin requests
-
Max TTL of 24 hours: Balances cache efficiency with content freshness requirements
-
Default TTL of 24 hours: Provides optimal caching for segments that don't have explicit cache-control headers
Channel assembly caching
For channel assembly workflows, manifests can be cached for short periods, while segments should be cached aggressively:
Content type | VOD TTL | Live TTL | Path pattern | Cache key elements |
---|---|---|---|---|
Multivariant playlists | 5-30 minutes | 5-10 seconds | Channel-specific paths | URL path + all query parameters |
Media playlists | 5-30 minutes | 2-5 seconds | Channel-specific paths | URL path + all query parameters |
DASH MPDs | 5-30 minutes | 5-10 seconds | Channel-specific paths | URL path + all query parameters |
Content segments | 24+ hours | 5-15 minutes | Content-specific paths | URL path only |
Ad segments | 24+ hours | 24+ hours | Ad-specific paths | URL path only |
-
Set short TTL values for manifests to ensure viewers receive up-to-date programming
-
Configure longer TTL values for content segments to maximize cache efficiency
-
Set up cache behaviors that include time-shift parameters in the cache key if you support time-shifted viewing
-
Include query parameters in the cache key to properly handle time-shifted viewing requests
For detailed TTL configuration settings and best practices, see Caching optimization for CDN and MediaTailor integrations.
Combined SSAI and channel assembly caching
When implementing both channel assembly and SSAI, ensure your caching strategy is consistent for both services to avoid conflicts and optimize performance:
Content type | Channel assembly | SSAI | Combined recommendation |
---|---|---|---|
VOD manifests | 5-30 minutes | 0 seconds | 0 seconds (SSAI takes precedence) |
Live manifests | 2-10 seconds | 0 seconds | 0 seconds (SSAI takes precedence) |
Content segments | 24+ hours | 24+ hours | 24+ hours (consistent) |
Ad segments | 24+ hours | 24+ hours | 24+ hours (consistent) |
This configuration maximizes cache efficiency while ensuring viewers receive up-to-date manifests for personalized ad insertion.