Skip to content

How to Purge the Cache

This guide shows you how to refresh cached content in Peakhour's CDN when you need to update your website content.

Before you begin: Review Cache Purging Concepts to understand the difference between soft and hard purges and when to use each approach.

Access the Cache Purge Interface

  1. Navigate to your domain dashboard in Peakhour
  2. Click on Purge in the main navigation menu

Choose Your Purging Method

Method A: Full Site Purge

Use this when you need to refresh all cached content:

  1. Select Full Site Purge option
  2. Choose purge type:

  3. Soft Purge: Revalidates all content with origin (recommended for routine updates)

  4. Hard Purge: Removes all content from cache (use for major changes)
  5. Click Purge All Content
  6. Confirm the action when prompted

Warning: Full site purges can temporarily impact site performance as the cache rebuilds.

Method B: Single Resource Purge

Use this to refresh specific files or pages:

  1. Select Single Resource Purge option
  2. Enter the complete URL of the resource to purge:
    https://yourdomain.com/path/to/file.jpg
    
  3. Choose purge type:

  4. Soft Purge: Revalidates the resource

  5. Hard Purge: Removes the resource from cache
  6. Click Purge Resource

Note: Wildcard URLs are not supported. Each resource must be specified with its exact URL.

Method C: Cache Tag Purge (API)

Use this for programmatic or bulk purging of tagged resources:

  1. Ensure your content includes appropriate cache tags (set via origin headers or rules)
  2. Use the Peakhour API to purge by tag:
    curl -X POST "https://api.peakhour.io/purge" \
    
      -H "Authorization: Bearer YOUR_API_TOKEN" \
      -H "Content-Type: application/json" \
    
      -d '{"tags": ["product-images", "blog-posts"]}'
    
  3. Monitor the purge status through the dashboard

Verify Purge Completion

  1. Check purge status: The interface will show progress and completion
  2. Test your content: Visit the affected URLs to confirm updates are visible
  3. Monitor performance: Watch for any temporary performance impacts during cache rebuild

Monitor Cache Rebuild

After purging:

  1. First visitors may experience slower load times as cache rebuilds
  2. Performance will improve as popular content gets re-cached
  3. Monitor your origin server for increased load during rebuild

Common Purging Scenarios

After Content Updates

  • Blog posts: Single resource purge for the specific post URL
  • Product images: Single resource or cache tag purge
  • Site-wide redesign: Full site hard purge

During Maintenance

  • Minor updates: Soft purge affected resources
  • Major updates: Full site soft purge
  • Emergency fixes: Hard purge specific resources immediately

Scheduled Updates

  • Daily content updates: Automate soft purges via API
  • Weekly maintenance: Schedule full site soft purges
  • Monthly reviews: Hard purge outdated content

Troubleshooting

Content not updating after purge:

  • Verify you purged the exact URL (including protocol, subdomain, path)
  • Check browser cache - force refresh with Ctrl+F5
  • Confirm origin server is serving updated content

Site performance decreased after purge:

  • This is temporary while cache rebuilds
  • Consider soft purge for less performance impact
  • Monitor origin server capacity during rebuild

API purge not working:

  • Verify API token permissions
  • Check cache tag implementation in your content
  • Review API response for error messages

Best Practices

  • Use soft purges for regular content updates
  • Reserve hard purges for critical changes
  • Purge during low-traffic periods when possible
  • Test purging procedures before major deployments
  • Monitor origin server capacity during large purges