Was this article helpful?
Thanks for your feedback
Contentstack purges cache of only the content that's changed (published, unpublished, or deleted) and other related data (referenced content) from the Content Delivery Network. Purging takes place only on the specific locale and environment on which the cached content exists.
For instance, when you delete a referred child entry, Contentstack purges all the cached entries of that child content type (on concerned locale and environment) and the cached entries of all parent content types (on concerned locale and environment) that refer to the child entry. The purging mechanism moves up the reference chain.
Contentstack purges cached data only when an API request attempts to publish, unpublish, or delete content. Such API requests comprise the name of the publishing environment as a query parameter.
Additional Resource: Learn how to scan the cache headers returned in response to an API request to determine where the content is delivered from.
Let us look at a few scenarios to understand how Contentstack purges only relevant cached content from the specific locale and environment.
Consider a scenario where you have a website’s home page that contains a section that displays recently added articles. The “Home Page” content type has a “Reference” field that refers to the “News Articles” content type to pick up newly added articles regularly. The content manager has also added an asset to the home page, which represents the company logo.
Each article also has references to a specific author bio from the “Author Details” content type. This content type contains bios for all authors that contribute to news articles. Apart from the biography, each entry of the “Author Details” content type also includes an asset representing the profile picture of a specific author.
The “News Articles” content type will have entries that contain details of specific news articles. Each article also comprises appropriate images related to the particular news item.
Refer to the list of articles given below:
Since the website is multilingual, the company publishes the above articles in the following languages:
The articles and the home page have been published on all the following environments to reflect the same changes everywhere:
The CDN stores cached copies of all these articles, the author bios, the home page, and all the referred assets once they are published.
Suppose if the content manager edits the company description in the “Home Page” content type. Once done, the author publishes the “English (United States)” version of the content to all the three available locales and on the “Production” environment.
The following cached data will be purged:
Note: We do not purge cached assets and download URLs when an entry is published or unpublished.
Suppose if the content manager replaces the existing company logo in the “Home Page” content type with the latest version. Once done, the content manager publishes the “English (United States)” version of the company logo to all the three available locales and on the “Staging” and “Production” environments.
The following cached data will be purged:
Note: We do not purge the cache of the download URLs of the assets when an asset is published or unpublished.
Now, suppose a content manager updates any article and publishes the changes to the “German (Germany)” locale and the “Development” environment.
The following cached data will be purged:
Note: We do not purge cached assets and download URLs when an entry is published or unpublished.
Suppose if the content manager deletes an author bio entry from the “Author Details” content type. This author’s bio was localized in “French (France)” and published to the “Production” environment.
The following cached data will be purged:
Note: We do not purge cached assets and download URLs when an entry is published or unpublished.
Suppose an author’s profile pic was being referred to in all the three locales: English (United States), French (France) and German (Germany), and published to the “Production” environment. For this example, we consider the following scenarios:
In both the scenarios mentioned above, the following cached data will be purged:
Note: We do not purge the cache of the download URLs of the assets when an asset is published or unpublished.
Was this article helpful?
Thanks for your feedback