Cache Purging

Remove cached content from the CDN when you need to update files.


When to Purge

Purge your cache when:

  • You've updated content that's already cached
  • You need to fix a mistake in cached content
  • You've changed caching settings
  • Debugging cache-related issues

Purge Methods

Purge All

Remove all cached content for your zone. Use sparingly as this will cause all requests to hit your origin temporarily.

Dashboard:

  1. Go to your zone settings
  2. Click "Purge Cache"
  3. Select "Purge All"
  4. Confirm the purge

API:

curl -X POST "https://nordiccdn.com/api/v1/zones/{uuid}/purge" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"type": "all"}'

Purge by Path

Remove specific files or directories from cache.

Dashboard:

  1. Go to your zone settings
  2. Click "Purge Cache"
  3. Select "Purge by Path"
  4. Enter the paths to purge
  5. Confirm the purge

API:

curl -X POST "https://nordiccdn.com/api/v1/zones/{uuid}/purge" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "path",
    "paths": [
      "/images/logo.png",
      "/css/style.css"
    ]
  }'

Purge by Wildcard

Use wildcards to purge multiple files matching a pattern.

Examples:

/images/*        # All files in /images/
/css/*.css       # All CSS files in /css/
/products/*/     # All product subdirectories

Purge Status

Purge requests are processed asynchronously. You can check the status:

Dashboard:

  • View the purge history in your zone settings
  • Status shows: Pending, Processing, Completed, or Failed

API:

curl "https://nordiccdn.com/api/v1/zones/{uuid}/purge/{purge_id}" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Propagation Time

Purges typically complete within:

  • Single file: 1-5 seconds
  • Wildcard/All: 5-30 seconds

The exact time depends on the number of edge servers and files being purged.


Rate Limits

To prevent abuse:

  • Purge All: 10 requests per hour per zone
  • Purge by Path: 1000 paths per request, 100 requests per hour

Best Practices

Avoid Frequent Purge All

Each "Purge All" causes a temporary increase in origin load. Instead:

  • Use path-based purging when possible
  • Implement cache busting with versioned URLs
  • Use appropriate cache TTLs

Cache Busting Alternatives

Instead of purging, consider:

<!-- Version query strings -->
<link rel="stylesheet" href="/style.css?v=1.2.3">

<!-- Filename versioning -->
<link rel="stylesheet" href="/style.abc123.css">

These approaches let you update content without purging, as the new URL creates a new cache entry.