• Home
Home
Anti-DDoS CDNStatic & dynamic acceleration, edge scrubbingAnti-DDoS IP forwardingL4 forwarding with protected IPsSDK game shieldClient SDK for gaming workloadsAnti-DDoS serversDedicated compute with high availabilityLearn more
Gaming solutionLow latency + protectionFinancial solutionCompliance & scrubbingLive streaming solutionPush/pull at the edgeBlockchain solutionWeb3 infra protectionExplore
DocumentationAPIs & onboardingHelp centerFAQs & ticketsBlog & newsUpdates & best practicesGlobal speed testMulti-region performance checksTag cloudTopic map across the siteOpen docs
AboutMission & visionCareersHiringPartnersEcosystemContactSales & supportContact us

Documentation

  • Introduction
  • Best Practices
Docs/Cache Configuration/Cache Purge

Cache Purge

速盾网络 Team
Docs

Tags

  • 缓存规则

On this page

No outline

Share

𝕏fin

Enterprise CDN & acceleration with AI-driven monitoring and full-spectrum, real-time DDoS/CC protection. Trusted by tens of thousands of companies for fast, secure, and reliable content delivery and DDoS mitigation.

Product

  • Anti-DDoS CDN
  • Anti-DDoS IP forwarding
  • SDK game shield
  • Anti-DDoS servers

Solutions

  • Gaming solution
  • Financial solution
  • Live streaming solution
  • Blockchain solution

Resources

  • Documentation
  • Help center
  • Blog & news
  • Global speed test

Company

  • About
  • Careers
  • Partners
  • Contact

© 2026-2028 sudun.com 保留所有权利

  • Privacy
  • Terms
  • Cookies

Cache purging removes cached content from Sudun edge servers, forcing fresh content to be fetched from your origin. This guide covers purge methods, best practices, and automation options.

When to Purge Cache

Common scenarios requiring cache purge:

ScenarioPurge TypeExample
Content updateSingle URLUpdated blog post
Site redesignPurge everythingNew CSS/JS deployed
Emergency fixURL or tagSecurity patch
Asset version changePrefix purge/assets/v2/*

Purge Methods

Purge by URL

Remove specific URLs from cache:

code
https://example.com/blog/post-1
https://example.com/images/hero.jpg
https://example.com/css/styles.css

Best for: Individual content updates, targeted cache clearing

Purge by Prefix

Remove all URLs matching a path prefix:

code
https://example.com/blog/*
https://example.com/images/*
https://example.com/api/v1/*

Best for: Section updates, versioned asset deployments

Purge by Cache Tag

Remove content by associated tags:

code
Tags: product-123, category-electronics, homepage

Best for: Dynamic content relationships, CMS integrations

Purge Everything

Remove all cached content for a domain:

code
Domain: example.com
Action: Purge All

Warning: Purging everything causes a surge of requests to your origin. Use sparingly and preferably during low-traffic periods.

Using the Dashboard

Purge Single URL

  1. Go to Domains → Select your domain
  2. Navigate to Caching → Purge Cache
  3. Select Purge by URL
  4. Enter the full URL(s) to purge
  5. Click Purge

Purge by Prefix

  1. Go to Caching → Purge Cache
  2. Select Purge by Prefix
  3. Enter the URL prefix (e.g., https://example.com/blog/)
  4. Click Purge

Purge Everything

  1. Go to Caching → Purge Cache
  2. Select Purge Everything
  3. Confirm by typing your domain name
  4. Click Purge All

Cache tags allow content-based purging without knowing exact URLs.

Setting Cache Tags

Add tags via response headers from your origin:

http
Cache-Tag: product-123, category-shoes, homepage

Or configure in Sudun:

json
{
  "cache_tags": {
    "rules": [
      {
        "match": { "path": "/products/*" },
        "tags": ["products", "catalog"]
      },
      {
        "match": { "path": "/blog/*" },
        "tags": ["blog", "content"]
      }
    ]
  }
}

Purging by Tag

bash
# Purge all content with tag "product-123"
curl -X POST https://api.Sudun.com/v1/domains/example.com/purge \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tags": ["product-123"]}'

Tag Best Practices

Tag TypeExampleUse Case
Entity IDproduct-123Purge when product updates
Categorycategory-electronicsPurge category pages
Content typeblog-postsPurge all blog content
Templatetemplate-homepagePurge after template change

Purge Propagation

After initiating a purge:

code
Purge Request → Sudun API → Global PoPs
                                  │
                          ┌───────┴───────┐
                          │               │
                     ~1-5 seconds    ~30 seconds
                     (most PoPs)     (all PoPs)
Purge TypeTypical Propagation
Single URL1-5 seconds
Prefix5-15 seconds
Cache Tag5-15 seconds
Everything15-60 seconds

Soft Purge vs Hard Purge

Hard Purge (Default)

Immediately removes content from cache:

code
Cache State: MISS
Origin Request: Required

Soft Purge

Marks content as stale but keeps it available:

code
Cache State: STALE
Origin Request: Background revalidation

Benefits of Soft Purge:

  • Prevents origin overload
  • Users see content immediately (stale)
  • Fresh content served after revalidation
bash
# Soft purge via API
curl -X POST https://api.Sudun.com/v1/domains/example.com/purge \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"urls": ["https://example.com/page"], "soft": true}'

Purge Automation

Webhooks

Trigger purge from your CMS or deployment pipeline:

bash
# WordPress example: purge on post update
curl -X POST https://api.Sudun.com/v1/domains/example.com/purge \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"tags": ["post-${POST_ID}"]}'

CI/CD Integration

Purge after deployment:

yaml
# GitHub Actions example
- name: Purge CDN Cache
  run: |
    curl -X POST https://api.Sudun.com/v1/domains/$DOMAIN/purge \
      -H "Authorization: Bearer $YESudunPI_KEY" \
      -d '{"prefix": "https://$DOMAIN/assets/"}'

Scheduled Purge

Set up automatic purge schedules:

  1. Go to Caching → Scheduled Tasks
  2. Click Add Schedule
  3. Configure:

- Frequency: Daily, Weekly, Custom

- Time: Choose off-peak hours

- Purge Type: Prefix or Tag

Rate Limits

Purge operations have rate limits to protect the system:

PlanURL Purges/minPrefix Purges/hrEverything/day
Starter100105
Business1,0005020
Enterprise10,000500Unlimited

Purge History

View purge history in the dashboard:

  1. Go to Caching → Purge History
  2. Filter by date, type, or status
  3. View details including:

- Timestamp

- Purge type

- URLs/Tags affected

- Propagation status

- Initiated by (user or API)

Troubleshooting

Content Still Cached After Purge

  1. Check URL exactness: Purge URL must match cached URL exactly

```

Cached: https://example.com/page?v=1

Purge: https://example.com/page ← Won't match!

```

  1. Query string variations: If caching includes query strings, purge all variations

  2. Browser cache: Clear browser cache or use incognito mode

  3. Propagation delay: Wait 30-60 seconds for global propagation

Purge Request Failed

ErrorCauseSolution
401 UnauthorizedInvalid API keyCheck API credentials
403 ForbiddenInsufficient permissionsVerify account access
429 Too Many RequestsRate limit exceededWait and retry
400 Bad RequestInvalid URL formatCheck URL syntax

Origin Overload After Purge All

If your origin struggles after a full purge:

  1. Use soft purge instead of hard purge
  2. Purge during low-traffic periods
  3. Implement staggered purge by prefix
  4. Enable origin shield for additional protection

API Reference

Purge by URL

bash
curl -X POST https://api.Sudun.com/v1/domains/example.com/purge \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://example.com/page1",
      "https://example.com/page2"
    ]
  }'

Purge by Prefix

bash
curl -X POST https://api.Sudun.com/v1/domains/example.com/purge \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"prefix": "https://example.com/blog/"}'

Purge by Tag

bash
curl -X POST https://api.Sudun.com/v1/domains/example.com/purge \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"tags": ["product-123", "homepage"]}'

Purge Everything

bash
curl -X POST https://api.Sudun.com/v1/domains/example.com/purge \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"purge_everything": true}'

Need help with cache purging? Contact support@Sudun.com