Cache TTL

Cache TTL

TTL (Time To Live)—the time the file copy exists in the cache. By default, all cache TTLs are 2 days with a maximum of 365 days. You can define TTL in days, hours, minutes, and/or seconds.

With enabled caching, when your content is first requested, Anycast CDN fetches it from your server and saves a copy of your file for future requests (caches it).

Cached content remains in the cache for as long as users continue to request it. You can configure how long the cache is viable until deemed inactive or outdated with the configurations below.

Active and Inactive TTLs

Inactive TTL

Inactive TTL specifies the period after which the cached file that has not been requested will be deleted from the cache.

 

Active TTL

Active TTL defines the period after which the cached file will be re-fetched from the origin and updated in the CDN cache. If the file has not been updated on your server since caching, only the headers will be re-cached, and the file will not be re-downloaded.

Cache TTL settings

Custom Active TTL based on HTTP codes

This feature allows separating Active TTL durations for individual HTTP status codes. For instance, 200 (Ok) responses can have a longer TTL, while errors like 403 (Forbidden) or 404 (Not Found) can refresh more often to ensure accuracy.

You can customize these TTLs based on your content strategies.

Custom Active TTL