Cache Priming is a performance optimization feature in Contentstack Launch that improves website speed by preloading critical content into the CDN cache before user access. This proactive caching reduces latency, minimizes server load, and ensures seamless content delivery.
Ideal for high-traffic websites, e-commerce platforms, and content-heavy applications, Cache Priming enhances the user experience by accelerating page load times and optimizing resource efficiency.
Cache Priming preloads pages and content onto the CDN cache during deployment, ensuring the latest versions are immediately available without requiring an initial request. By eliminating delays caused by backend processing or stale cache states, it consistently delivers fresh, optimized experiences.
Important: Cache Priming only works for routes whose responses are cacheable at the CDN layer. If a route's Cache-Control header includes no-store, no-cache, or must-revalidate, these directives instruct the CDN to skip storing the response and fetch directly from origin on every request. As a result, priming requests still run and appear in your logs, but no content is cached, and every request continues to be served directly from origin.
Ensure your routes return cacheable headers such as s-maxage=60 before relying on cache priming. See the Caching Guide for Contentstack Launch for details.
Modern front-end architectures rely on Server-Side Rendering (SSR), Incremental Static Regeneration (ISR), and Dynamic Static Generation (DSG) to serve dynamic content efficiently. However, these techniques can introduce longer build times and delays for first-time visitors. Cache Priming mitigates these issues by preloading critical content during deployment. By decoupling the build process from the user experience, it ensures fast access to pre-cached content, reducing wait times and improving efficiency, especially during peak traffic periods.
You can identify cache priming requests by their unique User-Agent header, allowing you to distinguish them from regular user traffic in your logs and monitoring systems.
All cache priming requests include the following User-Agent:
User-Agent: Contentstack-Launch/CachePrimingAgent/1.0
Use this value to filter cache priming traffic in your server logs or observability platform.
Follow the steps below to configure and implement Cache Priming in Contentstack Launch:
Example for launch.json Configuration:
{
"cache": {
"cachePriming": {
"urls": [
"/delay",
"/blog.html",
"/new-page.html"
]
}
}
}Note: Ensure the URLs you add return cacheable Cache-Control headers. Adding a non-cacheable route produces no performance benefit.
Choose one of the following methods to deploy your project in Launch:
Once the project is deployed, follow the steps below:



Note: Cache Priming takes effect from the next deployment of your project.
By leveraging Cache Priming, websites can achieve superior speed, reliability, and scalability, ensuring a seamless experience for users across all regions.
While Cache Priming helps reduce cold-start latency by preloading key routes into the cache, there are a few important limitations to consider: