---
title: "Revalidate, prime or redeploy? Picking the right cache lever on Launch"
url: "https://developers.contentstack.com/blog/revalidate-prime-or-redeploy-picking-the-right-cache-lever-on-launch"
type: "blogpost"
level: "intermediate"
intent: "learn"
outcome: "You can choose between revalidating, priming and redeploying for each kind of change on a Launch site."
prerequisites:
  - "A site hosted on Contentstack Launch"
  - "Basic understanding of CDN caching and Cache-Control headers"
tags:
  - "headless"
  - "api"
authors:
  - "Tim Benniks"
published: "2026-12-01T09:00:00.000Z"
updated: "2026-11-15T10:56:48.995Z"
---

# Revalidate, prime or redeploy? Picking the right cache lever on Launch

- **Authors:** Tim Benniks
- **Published:** 2026-12-01T09:00:00.000Z
- **Updated:** 2026-11-15T10:56:48.995Z
- **Level:** Intermediate
- **Intent:** Learn
- **Tags:** headless, api

---

When content on a Launch site looks stale, most teams redeploy. It always works, so it becomes the habit. But a redeploy is the most expensive of the three cache levers Launch gives you, and for most content changes it's the wrong one.

The three levers are revalidating the CDN, priming the cache, and redeploying. They solve different problems. Once you see which problem each one solves, the choice is usually obvious.

## The short version

Lever

What it does

What it costs

Use it when

Redeploy

Builds the site and purges the whole environment's CDN cache

A full build, every time

Code changed, or your pages are pre-rendered at build time

Revalidate

Purges cached responses by path, cache tag or hostname

One API call against a daily quota

Content changed on a server-rendered site

Prime

Requests a list of paths as part of a deployment so they're cached before visitors arrive

Origin load for those paths on each deployment

Your most visited pages are slow on a cold cache

Priming is not an alternative to the other two. It is the step that makes a redeploy less painful.

## What a redeploy really does

A deployment on Launch builds your project and, when it goes live, purges the CDN cache for that environment. Every page is a cache miss until someone requests it again.

That is why a redeploy fixes every staleness problem. It also means you pay for a full build and a cold cache for a one-word typo fix in a blog post. On a small site with a fast build that's fine. On a site with thousands of pages and a ten-minute build, an editor who publishes twenty times a day turns your build pipeline into a queue. Launch helps a bit here: when several deployments are triggered for one environment, it skips the queued ones in between. You still wait for the latest.

You can trigger a redeploy from a deploy hook, from the CLI with csdx launch --redeploy-latest, or from the Launch API. If you drive this from a pipeline, [Deploy from CI with the Launch CLI, REST API and deploy hooks](/guides/deploy-from-ci-with-the-launch-cli-and-api) shows the whole setup.

## What revalidation really does

Revalidation drops cached entries without building anything. You call the Revalidate CDN Cache endpoint on the Launch API with exactly one of three inputs:

```json
{ "cachePath": { "path": "/blog/my-post", "isPrefix": false } }
```

```json
{ "cacheTags": ["prod-blog"] }
```

```json
{ "hostnames": ["www.example.com"] }
```

The next request for a purged page goes to your origin and gets cached again. Nothing else on the site is touched.

This only makes sense when your origin can render fresh content on request. For a server-rendered page with Cache-Control: public, max-age=0, s-maxage=86400, revalidation is ideal: the CDN holds the page for a day, and you purge it the moment an editor publishes. For a page that was pre-rendered at build time, purging the CDN just fetches the same stale HTML again. That page needs a build.

Two practical notes. Revalidation has a daily quota per organization, which you can check with GET /usage-analytics/revalidate-cdn-cache. And cache tags are the way to stay well under it, because one tag purge can clear hundreds of URLs. I prefix every tag with the environment, like prod-blog and staging-blog, so a purge meant for staging can't touch production pages that share a tag name.

You can wire revalidation to publishing with the Launch connector in Automations, or with a small webhook route in your app. Both are covered step by step in [Caching, revalidation and cache priming](/guides/launch-edge-functions-redirects-and-caching/caching-revalidation-and-cache-priming).

## What priming really does

Cache priming takes a list of paths from launch.json and requests them as part of each deployment:

```json
{
  "cache": {
    "cachePriming": {
      "urls": ["/", "/pricing", "/docs", "/blog"]
    }
  }
}
```

You also switch on Enable Cache Priming in the environment's cache settings. After that, your homepage and top landing pages are already in the CDN when the first visitor arrives after a release.

The limits are what make it a supporting act. Paths must be relative and listed one by one; wildcards and regex aren't supported. Routes that send no-store or no-cache are requested but never cached, so priming them does nothing. And it only runs on a deployment, so it doesn't help after a revalidation. If your list comes from content, generate launch.json at build time instead of maintaining it by hand.

## A decision flow

This is the order I go through when something on a Launch site needs to change:

flowchart TD  A[Something changed] --> B{Code or config?}  B -->|Yes| R[Redeploy]  B -->|No, content| C{Is the page pre-rendered at build time?}  C -->|Yes| R  C -->|No, server-rendered with s-maxage| D{How many pages are affected?}  D -->|One or a few known URLs| P[Revalidate by path]  D -->|A section or everything using a component| T[Revalidate by cache tag]  D -->|One of several domains| H[Revalidate by hostname]  R --> E{Are top pages slow on a cold cache?}  E -->|Yes| F[Add them to cache priming]  E -->|No| G[Done]Code changes always need a deployment. Content changes need a deployment only if the content is baked into the build. Everything else is a question of how wide the purge should be.

## How we do it on this site

developers.contentstack.com runs on Launch, and it takes the redeploy route on purpose. Content pages are pre-rendered at build time with generateStaticParams, and a publish triggers a rebuild. Pages are served from the CDN as static HTML, and the origin almost never does any rendering work during a visit.

That choice works because the build is fast enough to run on every publish. A news site or a large commerce catalog would make the opposite choice: render on the server with a long s-maxage, tag responses by content type, and revalidate on publish. Pick the lever whose cost matches how often the change happens. Rare publishes can afford a build. Frequent publishes can't.

## Mistakes I keep seeing

Redeploying on every publish for a large site. The webhook goes straight to a deploy hook, editors publish in bursts, and the queue never empties. Switch those pages to server rendering with s-maxage and revalidate instead.

Revalidating pre-rendered pages. The purge works, the CDN fetches the page again, and it's the same old HTML. If the content is in the build output, only a build updates it.

Priming routes that can't be cached. Check the Cache-Control of every path on your priming list. A no-store page on that list costs origin requests and gives nothing back.

Cacheable pages that read cookies. The Launch CDN caches by URL, not by cookie. If a page renders differently per visitor, send no-store or move the personal part to a client-side call. For A/B tests, rewrite each variant to its own URL in an edge function, as shown in [Edge functions in practice](/guides/launch-edge-functions-redirects-and-caching/edge-functions-in-practice).

A broken automation eating the quota. A flow that fires the same purge in a loop, or sends a tag that never resolves, still counts every call. Check your revalidation usage after you set up a new automation.

## Concluding

Redeploy when code changes or when content lives in the build. Revalidate when content changes on a server-rendered page, and prefer tags over long lists of paths. Prime the handful of pages that matter most, so a deploy doesn't hand your first visitors a cold cache.

Start by checking two things on your own site: whether your content pages are pre-rendered or server-rendered, and what Cache-Control they send. Those two answers decide which lever you need.



---

## Do this with AI

Install the launch-platform skill from [Contentstack agent skills](https://github.com/contentstack/contentstack-agent-skills) and connect the Launch Deploy Helper profile in MCP Profile Hub. Then ask your agent:

> Look at last week's deployments on my Launch project and tell me which redeploys only shipped content changes and could have been a cache revalidation instead.

New to this? [Set up your AI workbench](/guides/set-up-your-ai-workbench-for-contentstack) first.




---

## Frequently asked questions

### Does redeploying on Launch clear the CDN cache?

Yes. Every deployment purges the CDN cache for that environment, which is why a redeploy always shows fresh content.

### Is cache priming a replacement for revalidation?

No. Priming warms a fixed list of paths as part of a deployment. It doesn't react to content changes, so you still need revalidation or a redeploy for those.

### When should I revalidate instead of redeploying?

When the change is content, not code, and your pages are server-rendered with an s-maxage. Revalidation purges only what changed, without a build.

### Can I prime the cache without deploying?

Not with the built-in feature. Cache priming runs as part of a deployment, for the paths you list in launch.json.

