Cache Control
Cache Control policies optimize content delivery performance by configuring Time to Live (TTL) settings and cache behavior options. These policies enhance CDN hit ratios and reduce origin server load.
![Figure Needed] Screenshot showing cache control policy configuration interface
Cache Configuration Options
Time to Live (TTL)
The duration in seconds that resources are cached on the CDN system to serve users. Proper TTL configuration balances content freshness with performance optimization.
Ignore Origin Server No Cache
Removes cache-control headers like "no-cache" and "no-store" from origin server responses, allowing CDN caching even when origin servers specify no caching.
Ignore Client No Cache
Removes the "no-cache" header from client requests, preventing clients from bypassing CDN cache with cache-busting requests.
Ignore Query String
Ignores query strings during cache storage, significantly increasing the HIT ratio on the CDN by treating URLs with different parameters as the same cached resource.
Cache Optimization Benefits
These options enhance CDN HIT ratio performance, with "Ignore Query String" providing particularly significant improvements. However, implementation depends on website operational requirements.
Query String Behavior Example
When "Ignore Query String" is enabled, the CDN system provides the same cached data for all variations of a URL:
http://www.example.com/path/to/photo.jpg
http://www.example.com/path/to/photo.jpg?clientId=12345&product=A123
http://www.example.com/path/to/photo.jpg?clientId=67890&product=A456
All three URLs will serve the same cached version of photo.jpg
.
Policy Application
URL Pattern Matching
Cache policies are applied to resources based on URL patterns using:
- Prefix Matching: Applies to URLs starting with specified path
- Suffix Matching: Applies to URLs ending with specified extension
- Regular Expression Matching: Complex pattern matching for advanced use cases
Policy Priority
When multiple cache policies match a URL, the most specific policy takes precedence:
- Longest prefix match
- Most specific regular expression pattern
- Default cache behavior if no policies match
Implementation Considerations
Content Type Suitability
- Static Assets: Images, CSS, JavaScript files benefit from longer TTL values
- Dynamic Content: API responses, user-specific content require shorter TTL or cache bypass
- Frequently Updated Content: News, real-time data need careful TTL configuration
Website Compatibility
Before enabling cache optimization options, consider:
- Dynamic Parameter Handling: Whether query parameters affect content delivery
- User-Specific Content: Personalized content that should not be shared
- Cache Invalidation Requirements: How frequently content updates occur
Performance Monitoring
Cache Hit Ratio Tracking
Monitor cache effectiveness through analytics:
- Request Hit Ratio: Percentage of requests served from cache
- Byte Hit Ratio: Percentage of bytes served from cache
- Origin Offload: Reduction in origin server requests
Optimization Recommendations
- Start with conservative TTL values and increase based on performance data
- Monitor cache hit ratios after policy changes
- Use ignore query string carefully to avoid serving incorrect content
- Test policies thoroughly before production deployment