Updated on 2026-04-24 GMT+08:00

TTL Source

Description

TTL Source determines the cache time to live (TTL) used by CDN points of presence (PoPs). It defaults to the TTL set on CDN. Options include:

  • Origin server: CDN PoPs use the cache TTL set on the origin server.
  • CDN: CDN PoPs use the cache TTL set in cache rules on CDN.
  • Whichever is shorter: CDN PoPs use the shorter TTL between the TTL set in cache rules on CDN and that set on the origin server.
  • If both Cache-Control and Expires are configured on the origin server, Cache-Control is preferentially used.
  • If TTL Source is set to Origin server, but neither Cache-Control nor Expires is configured on the origin server, CDN PoPs use the TTL set in cache rules on CDN.

Working with Forcible Cache

Table 1 Effects of using Forcible Cache with TTL sources

TTL Source

Forcible Cache

Effect

Origin server

Disabled

  • If no-cache, private, or no-store is set in the Cache-Control response header of the origin server, CDN PoPs will not cache resources.
  • If other directives are set on the origin server, the cache priority is s-maxage > max-age > expires. For example, if Cache-Control: max-age=500, s-maxage=400 is set on the origin server, CDN PoPs cache resources for 400s, as specified by s-maxage.
  • If none of these directives are set on the origin server, CDN uses the cache TTL set on its console.

Origin server

Enabled

The no-cache setting of the origin server is ignored. Resources are still cached even if no-cache, private, or no-store is set in the Cache-Control response header of the origin server. The cache logic is as follows:

  • If directives are set on the origin server, the cache priority is s-maxage > max-age > expires. For example, if Cache-Control: max-age=500, s-maxage=400 is set on the origin server, CDN PoPs cache resources for 400s, as specified by s-maxage.
  • If none of these directives are set on the origin server, CDN uses the cache TTL set on its console.

CDN

Disabled

  • If no-cache, private, or no-store is set in the Cache-Control response header of the origin server, CDN PoPs will not cache resources.
  • If noun of no-cache, private, and no-store is set in the Cache-Control response header of the origin server, CDN uses the cache TTL set on its console.

CDN

Enabled

CDN ignores response headers from the origin server and uses the cache TTL set on the CDN console.

Whichever is shorter

Disabled

  1. When the cache TTL set on CDN is shorter:
    • If no-cache, private, or no-store is set in the Cache-Control response header of the origin server, CDN PoPs will not cache resources.
    • If noun of no-cache, private, and no-store is set in the Cache-Control response header of the origin server, CDN uses the cache TTL set on its console.
  2. When the cache time set on the origin server is shorter:
    • If no-cache, private, or no-store is set in the Cache-Control response header of the origin server, CDN PoPs will not cache resources.
    • If other directives are set on the origin server, the cache priority is s-maxage > max-age > expires. For example, if Cache-Control: max-age=500, s-maxage=400 is set on the origin server, CDN PoPs cache resources for 400s, as specified by s-maxage.
    • If none of these directives are set on the origin server, CDN uses the cache TTL set on its console.

Whichever is shorter

Enabled

  1. When the cache TTL set on CDN is shorter, CDN uses it and ignores response headers from the origin server.
  2. When the cache time set on the origin server is shorter, the no-cache setting of the origin server is ignored. In this case, resources are still cached even if no-cache, private, or no-store is set in the Cache-Control response header of the origin server. The details are as follows:
    • If directives are set on the origin server, the cache priority is s-maxage > max-age > expires. For example, if Cache-Control: max-age=500, s-maxage=400 is set on the origin server, CDN PoPs cache resources for 400s, as specified by s-maxage.
    • If none of these directives are set on the origin server, CDN uses the cache TTL set on its console.