• 首页
首页
高防CDN静态与动态加速,边缘清洗与调度高防IP转发四层转发,业务 IP 高防接入SDK游戏盾客户端集成,游戏业务专属防护高防服务器独享资源,稳定抗 D 与高可用了解更多
游戏解决方案低延迟与防护一体化金融解决方案合规与流量清洗直播解决方案推拉流与边缘加速区块链解决方案Web3 基础设施防护查看方案
技术文档API 与接入指南帮助中心常见问题与帮助文档博客资讯产品动态与最佳实践全球测速多节点网络性能测试标签云按主题聚合全站内容进入文档
关于我们使命与愿景加入我们招聘与内推合作伙伴渠道与生态联系我们咨询与售后联系我们

文档目录

  • 技术文档
  • 最佳实践
文档/缓存配置/缓存刷新

缓存刷新

速盾网络 团队
技术文档

标签

  • 缓存规则

本页内容

暂无目录

分享文章

𝕏fin

企业级CDN与加速解决方案,AI智能监测优化,实时全方位DDoS/CC防护。全球数万家企业信赖,提供快速、安全、可靠的内容分发与抗DDOS攻击服务。

产品

  • 高防CDN
  • 高防IP转发
  • SDK游戏盾
  • 高防服务器

解决方案

  • 游戏解决方案
  • 金融解决方案
  • 直播解决方案
  • 区块链解决方案

资源

  • 技术文档
  • 帮助中心
  • 博客资讯
  • 全球测速

公司

  • 关于我们
  • 加入我们
  • 合作伙伴
  • 联系我们

© 2026 Sudun. 保留所有权利。

Cache Purge

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