Prompt

My CDN is serving stale files after deploys, how do I fix cache purging?

Technology / CDN & Edge Infrastructure1 observationLast seen Oct 12, 2026

Latest observation

Oct 12, 2026OpenAI APIWeb search: off

Stale CDN content after deploy usually comes from one of a few issues: the CDN cache wasn’t actually invalidated, the origin is still serving cacheable headers, or the app is using filenames/URLs that don’t change between deploys.

Best fix: use cache-busting asset URLs

Instead of purging every deploy, make static assets immutable and change the URL whenever the content changes.

Examples:

  • app.css → app.8f3a1c.css
  • main.js → main.a91c2d.js
  • or add a version query string, though filename hashing is usually better

Then set headers like:

  • Cache-Control: public, max-age=31536000, immutable for hashed assets
  • Cache-Control: no-cache or a short TTL for HTML and config files

This is the most reliable approach because the CDN doesn’t need to guess what changed.

If you want to purge on deploy

Make sure the purge targets the exact URLs the CDN cached.

1) Purge the right paths

Common mistake: purging /static/* when the CDN cached:

  • /app.js
  • /assets/app.1234.js
  • /index.html

Use:

  • exact URLs, or
  • wildcard purge if your CDN supports it

Examples:

  • purge /index.html
  • purge /assets/*
  • purge by cache tag, if supported

2) Purge after the new files are uploaded

If you purge first, the CDN may re-cache old files from origin before the deploy finishes.

Recommended order:

  1. Upload new build artifacts
  2. Verify origin serves the new version
  3. Purge CDN cache
  4. Confirm the CDN fetches the new content

3) Check origin cache headers

If your origin sends long cache headers on HTML, the CDN may keep serving stale pages even after deploy.

For HTML:

  • Cache-Control: no-cache, must-revalidate or
  • Cache-Control: max-age=0, s-maxage=60 depending on your setup

For hashed assets:

  • long-lived caching is fine

4) Verify the purge actually succeeded

Most CDNs return a purge request success response, but you should still verify:

  • check CDN response headers like Age, X-Cache, CF-Cache-Status, X-Served-By
  • confirm the content hash or build ID changed
  • request the asset with a cache-bypass header or query param if your CDN allows it

Common causes of stale content

  • HTML cached too long at the CDN
  • Same asset filenames across deploys
  • Service worker serving old assets
  • Browser cache, not CDN cache
  • Purging the wrong hostname or environment
  • Origin ETag/Last-Modified causing unexpected revalidation behavior
  • Multiple CDN layers or a reverse proxy in front of the CDN

Recommended deploy pattern

  1. Build assets with content hashes
  2. Set HTML to short/no cache
  3. Set hashed assets to immutable long cache
  4. Deploy new assets
  5. Deploy new HTML last
  6. Optionally purge only HTML

That usually eliminates the need for broad CDN purges.

Quick diagnostic checklist

  • Does the asset URL change when content changes?
  • Are you purging the exact CDN hostname and path?
  • Is HTML cached too aggressively?
  • Are you purging after upload?
  • Is there a service worker involved?
  • Are browser DevTools showing from disk cache instead of CDN?

If you tell me which CDN you use (Cloudflare, Fastly, Akamai, CloudFront, etc.) and how you deploy assets, I can give you the exact purge configuration and headers to use.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.