To ensure blazing fast content delivery, Contentstack has set up a CDN for its APIs. So, if you are using Contentstack, fast content delivery comes by default. Contentstack has its own CDN endpoints to deliver content. Learn more about our CDN.
If you want to accelerate the pace of delivery further and gain even more control over your digital properties, you can set a separate CDN for your project. This CDN ensures that a cache system is available between your web server and the browser. So, page requests come directly from the cache, instead of from the web server or the Contentstack server.
Here’s what happens when you set up your own CDN:
From the above, it is evident that having multiple CDNs in place ensures fast delivery of content and reduces the number of calls to the Contentstack server.
Let’s look at the steps involved in setting up a CDN for your site.
The first step is to choose the right CDN provider. Before you choose one from the numerous options available, evaluate the solutions carefully.
A good way to do this is:
Once you have selected and registered your website with the CDN, you can move onto setting it up on your website.
If you don't have your website ready, create one and install the required plugins to enable communication between your website and CDN.
Connecting your website to the selected CDN depends on which one you have selected. Firstly, check with your CDN provider if there are any required activation steps. Some CDN providers, such as CloudFlare, have clear instructions and offer a custom plugin for ensuring smooth syncing of your files with their CDN server and nodes.
Data Purging refers to the flushing of the data from the CDN cache. You need to balance when and why data is purged from the cache to ensure users receive up-to-date content while keeping costs down and performance high.
You can choose to clear all cache data from the CDN whenever new content is published, or any existing content is updated. The other option is to purge the cached data of only the content that has been updated. You can also schedule your purges as desired. So for example, you can purge data after every X minutes when the content is updated in Contentstack.
If you get stuck, you can contact their support team. After your files have synced with the CDN provider, set up your website to ensure it creates a communication channel with the CDN so that content gets cached in your CDN correctly.
You can make use of Contentstack Webhooks to trigger that the cache is no longer valid and content and the CDN should purge the cache according to the rules you have set up.
Note: The above steps may vary depending upon the CDN service provider you choose.