Prompt
I'm unhappy with CDN rules not being enough for our app logic
Latest observation
Oct 26, 2026
OpenAI APIWeb search: off
That’s a valid concern. CDN rules are great for edge caching, redirects, headers, and basic request filtering, but they’re usually not enough for app-specific logic.
If your app needs things like:
- user/session-aware decisions
- feature-flag routing
- authorization checks
- dynamic personalization
- A/B test assignment
- tenant-based behavior
- request transformations based on business logic
…then you typically want that logic in one of these places instead:
Better options
-
Application layer
- Put the logic in your backend/service code.
- Best when decisions depend on business rules or data.
-
Edge compute / workers
- Use something like Cloudflare Workers, Fastly Compute, or similar.
- Good when you want low-latency logic close to users, but still more powerful than CDN rules.
-
API gateway / reverse proxy
- Useful for centralized request policy, auth, shaping, and routing.
-
Feature flag / config service
- If the “logic” is really control-plane behavior, move it into a config system rather than hardcoding CDN rules.
Rule of thumb
If the logic would be hard to explain as a simple deterministic routing/cache rule, it probably doesn’t belong in CDN rules.
Practical approach
A common pattern is:
- CDN handles static caching and simple edge behavior
- edge worker handles lightweight request logic
- app backend handles business decisions
If you want, I can help you:
- identify which of your current CDN rules should move elsewhere, or
- design a cleaner architecture for your app logic at the edge.