CDN-Cache and Perma-Cache Headers Explained

Whenever you use our CDN with Perma-Cache, you will encounter two important headers related to caching: CDN cache and Perma-Cache. These headers indicate the cache status across different layers of our content delivery infrastructure.

CDN cache header

The CDN cache header indicates whether the requested content was served from the CDN's edge cache. Possible values:

  • Hit: Content was loaded from the CDN cache.
  • Miss: Content was not found in the CDN cache and was either loaded from Perma-Cache or fetched from the origin server.

Perma-Cache header

Perma-Cache header shows whether the requested content was served from Perma-Cache, our long-term storage solution. Possible values:

  • Hit: Content was loaded from our Perma-Cache storage.
  • Miss: Content was not found in Perma-Cache and was fetched from the origin server.

Cache behavior explained

The CDN cache and Perma-Cache headers can appear in any combination of hit or miss statuses, reflecting where the content was sourced from. Here's what each combination means:

  • Both miss: Neither the CDN edge nor the Perma-Cache had the file, requiring a fetch from the origin. The Perma-Cache system will be signaled to fetch the file in the background for future requests.
  • CDN cache hit, Perma-Cache miss: The file was loaded from the CDN cache. It is important to note here that the CDN-Cache header status is cached. This means that even if the CDN-Cache indicates a "Hit," the Perma-Cache status may still display a "Miss." This scenario implies that until the CDN cache expires, users may not be aware of the content's availability in Perma-Cache. This detail is critical for understanding the caching layers and their refresh cycles.
  • CDN cache miss, Perma-Cache hit: The file wasn’t in the CDN cache but was loaded from Perma-Cache.
  • Both hit: The file was available in both the CDN cache and Perma-Cache.

Each request could see any combination of hit and miss across these two headers, revealing where the content is being served from and whether an additional fetch from a further source is required. Understanding these statuses helps in diagnosing cache performance and planning cache strategies more effectively.

Table of Contents

Was this article helpful?
11 out of 13 found this helpful