CDN Cache & Rules

Configure caching policies and page rules to optimize performance.

Cache Policies

Cache TTL

Set how long content is cached at the edge:

Content TypeRecommended TTL
Static assets (JS, CSS, images)1 year
HTML pages1 hour - 1 day
API responsesNo cache or short
Dynamic contentNo cache

Cache Key

Customize what makes a unique cache entry:

    1. Query String - Include all, some, or ignore
    2. Headers - Vary by Accept-Language, etc.
    3. Cookies - Include specific cookies

Page Rules

Create rules to match URL patterns and apply behaviors:

Rule Examples

Force HTTPS:

Match: http://example.com/
Action: Redirect to HTTPS

Bypass cache for API:

Match: /api/
Action: Cache bypass

Cache static files:

Match: .jpg, .png, .css, *.js
Action: Cache for 1 year

Cache Purge

Clear cached content when you update your site:

    1. Purge URL - Clear specific URLs
    2. Purge Tag - Clear by cache tag
    3. Purge All - Clear entire cache (use sparingly)
# Purge via API
curl -X POST https://api.zonecloud.com/v1/cdn/domains/{id}/purge \
  -H "Authorization: Bearer YOUR_KEY" \
  -d "urls[]=/path/to/file.css"

© 2026 ZoneCloud. All rights reserved.