Open the CDN zone → Rules tab in my.cubepath.com.
Edge Rules change how the CDN handles a request right at the edge, before it ever reaches your origin. They let you control caching, redirects and HTTP headers for specific parts of your site without touching application code — and without a deploy.
Every rule belongs to one zone and only affects traffic served through that zone.
How rules are evaluated
Each rule has a priority from 0 to 65535, and rules run from the lowest number to the highest. A rule at priority 10 is checked before one at 100, so specific rules belong at low numbers and catch-alls at high ones.
A rule only acts on requests that match its conditions. Leave the conditions empty and it applies to all traffic in the zone. Set several and a request must satisfy all of them.
Matching conditions
You can target requests by any combination of:
| Condition | Example |
|---|---|
| Path | /static/*, /images/*.jpg |
| HTTP method | GET, POST, PUT… |
| Host | A specific hostname, when the zone serves more than one |
| Headers, query parameters or cookies | Any name/value |
| Country | Two-letter code: US, ES, DE |
| IP address or network range | CIDR |
| User Agent | A pattern |
Any rule can also carry an expiry date, after which it stops applying on its own — useful for campaigns and seasonal redirects. And every rule can be switched off without deleting it.
Rule types
Cache
Sets how long the edge keeps a copy of the matching content. You set an edge cache lifetime (how long our servers hold the file) and optionally a browser cache lifetime (how long the visitor's browser holds it).
Longer lifetimes mean fewer trips to your origin, faster pages and lower bandwidth cost. Best for things that rarely change: images, fonts, CSS, JavaScript.
Cache Bypass
Forces matching content to always be fetched fresh and never cached. Use it for anything personalised or transactional: carts, checkout, logged-in dashboards, dynamic API endpoints.
WarningGetting this wrong is the one CDN mistake that's genuinely dangerous. A cached logged-in page can be served to a different visitor. Bypass cache on every authenticated path before you widen caching anywhere else.
Redirect
Sends visitors elsewhere — a path on the same site or a full URL — as a permanent (301, 308) or temporary (302, 307) redirect. Use it to retire old URLs, force one canonical hostname, or point a dead page somewhere useful.
Request Header
Adds, changes or removes a header on the request before it reaches your origin. Leave the value empty to strip a header. Useful for passing context to your application or cleaning up headers you don't want upstream.
Response Header
Adds, changes or removes a header on the response sent back to the visitor. Leave the value empty to remove one. Common uses: security headers, custom cache hints, CORS headers.
Good practice
- Start with cache rules on your static assets. It's the change with the biggest speed and cost benefit for the least effort.
- Always bypass cache on dynamic and logged-in pages, so no visitor sees content meant for someone else.
- Reserve 301 for moves that are truly permanent. Browsers and search engines remember them for a very long time; use 302 while you're unsure.
- Use priorities deliberately: specific paths first, catch-alls last.
TipAfter adding a cache rule, watch the cache hit rate in Analytics. A rule that's matching correctly makes that number climb within minutes — if it doesn't move, your conditions aren't matching what you think they are.
To control who can reach your content and how much traffic they can send, see WAF.