Overview
Cache Settings allow you to set how and when assets stored on a particular Scope in the CDN cache should be purged and replaced with fresh content from the Origin.
Caching content is one of the primary functions of a CDN. When you properly configure how and when new content is stored in the CDN cache, you enhance the delivery of your content to your customers on the web, and by optimizing how the CDN caches your content you reduce the stress of unnecessary requests placed on your Origin.
CDN Caching
CDN Caching lets you define how and when content stored specifically in the CDN cache expires and is replaced with new content from your Origin.
By default, when a new Site is created, the Cache Expiration Method will be set to Origin Controlled, meaning the CDN will honor the cache-control header set by your Origin.
Cache Expiration Method
The Cache Expiration Method indicates that cache-control headers on content from your Origin will determine expiration. The options bulleted below are selectable in your account from the dropdown.
- Origin Controlled - Cache-control headers on content from your Origin will determine expiration.
- Relative to Ingest - The time of ingest plus CDN TTL will determine expiration.
- Relative to Last Modified - CDN TTL will be used to check the Origin for modified assets, and if assets are modified the CDN will pull and cache them.
- Never Expire - Content in cache will remain in cache eternally.
CDN TTL
A CDN TTL is the expiration time used for content pulled from your origin server.
- If Cache Expiration Method is set to Origin Controlled and there is no cache-control header associated with the content, the CDN TTL is the default caching max-age for content. A value of 0 in this case indicates the asset should be cached as long as possible.
- If Cache Expiration Method is set to Relative to Ingest or Relative to Last-Modified, CDN TTL is the number of seconds since ingest, last access, or last modified to wait before expiring the asset.
Deliver These Origin Headers
This setting Indicates that time of ingest plus CDN TTL will determine expiration.
Do Not Cache
This setting tells the CDN to not cache the asset. All headers will be straight proxied to and from the origin.
Stale Cache Extension
Stale Cache Extension allows you to tell the CDN how to treat stale content.
Sometimes your Origin may become unresponsive. In the event that it does, the CDN will retain stale content for as long as you wish and will continue trying your Origin for a response. How long the CDN does these things is all up to you.
Stale Cache Retry Timer
In the event your Origin is unreachable, the CDN will try to establish a connection with it every 5 seconds. 5 seconds is the default but you can shorten or extend the Stale Cache Retry Timer if you need to.
Maximum Stale File TTL
If a lack in response from your Origin is everlasting, the CDN will keep stale content cached for as long as you'd like as specified by this option and continue trying to reach your Origin every so many second as specified by the Stale Cache Retry Timer. There is no default set for Maximum Stale File TTL.
If your Origin fails to respond after the time set by the Maximum Stale File TTL, the CDN will stop retrying your Origin, it will stop delivering stale content, and the end-user will receive an error message.
Browser Caching
The end user's browser will cache content in a variety of ways. This policy and its options are not required but allow you to apply custom browser caching behaviors.
Browser TTL
Browser TTL is the expiration time used to control how long content can be cached by the end user's browser, independently of how long that content is cached on the CDN.
Synchronize Browser And CDN TTLs
When you sync the Browser and CDN TTLs, the end user's browser will match its own cache TTL to the amount of time remaining before the CDN TTL expires. Essentially, it's a prorated TTL based on the length of time remaining before the CDN TTL expires.
Exceptions
By adding Exceptions, you can easily target specific files on a given Scope that require unique treatment by a particular configuration policy. Exceptions allow you to do this without creating additional Scopes for files that require unique treatment.
Exceptions allow you to target specific files based on at least one of the methods listed below:
- Header Filter - Target files based on a specific header. i.e. “Host:"
- Path Filter - Target files based on their specific path. i.e. “/path/to/file.ext"
- Respond with Status Code - Target files based on a specific response code. i.e. “301"
- HTTP Method Filter - Target files based on a specific method. i.e. “PUT"