Contentstack CDN Cache Management

A content delivery network (CDN) ensures that a cache of your content is stored at various locations around the globe. Consequently, whenever there is a page request, the content is served from the cache of the nearest CDN server, rather than the origin server, ensuring quicker content delivery. Learn more about how CDNs work.

How CDN Cache Works in Contentstack

The CDN is always up-to-date. It ensures that the cache is always fresh through purging old data and caching new data.

When a piece of content is requested by any user, the nearest CDN server checks if it has a cached copy of the requested content. If not, it checks with the shield server. And, if the shield server does not have the cache of the requested content, it fetches the content from the origin server.

A shield server is an extra layer of caching that reduces the load on the origin server. It is located near the origin server, and it saves the cache of content that it serves to any CDN server. So, if any other CDN server requests for the same data, the shield server would serve the cached content.

This ensures that content is always available and is delivered even in cases of high visitor traffic, intermittent spikes as well as server outages, resulting in better customer experience and satisfaction.

Cache Purging

Purging refers to the removal of the cache from the CDN servers and the shield server.

Cache is purged in two scenarios:

  • When content is updated:
    Content remains cached on our CDN service until a publish, unpublish, or delete activity is performed. Once a user publishes any content or performs any of the above activities, the cache (on CDN as well as shield servers) of all entries and assets is purged.
  • Automatic purging after 24 hours:
    A cached copy of your content stays on the CDN and the shield server for a maximum period of 24 hours from the time of fetching the data. Post 24 hours, the server purges the cached copy automatically.
Was this article helpful?
top-arrow