Start with the content
If one distribution serves both public assets and private application paths, use delivery rules to apply path-specific settings. Verify the matched rule as well as the distribution’s base configuration.
Set edge and browser freshness
Open the distribution’s Cache page. Bothedge_cache and browser_cache have an enabled switch, a controlled_by mode, and a TTL in seconds.
For a public file that changes at the same URL, an edge TTL of 3,600 seconds allows an edge copy to remain fresh for an hour. Choose the browser TTL separately: an edge purge cannot remove copies already stored in visitors’ browsers.
Use versioned URLs such as
/assets/app.8f3c.css when you need long browser freshness and predictable releases.
Choose query-string behavior
Thecache_key.ignore_query_string object controls whether query parameters distinguish cached responses.
For example, if
?v=1 and ?v=2 select different assets, ignoring v can return the wrong release. Ignoring a tracking parameter is appropriate only when that parameter does not affect the response.
A custom key can use supported variables such as $request_uri, $uri, $scheme, and $http_x_cdn_real_host. Use a custom expression only when you can explain every input that distinguishes responses.
Review optional controls
Keep these disabled unless the workload needs them and you have tested the resulting behavior.
Save and test
- Save the cache configuration. Through the API, submit the full cache document; follow update configuration.
- Request a known public file through the CDN hostname and inspect the status, body, and cache headers.
- Repeat the same request, then test meaningful query variants and paths governed by delivery rules.
- Check request logs and analytics when available. A single request or missing cache header does not establish cache behavior across all locations.
- After correcting a policy, purge affected paths if existing edge copies must be invalidated.