You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* perf(cache): add CF edge caching, eliminate request storms
Three changes to reduce origin request volume:
1. Gateway cache tiers now include `public, s-maxage` so Cloudflare
can cache API responses at edge (previously browser-only). Bumped
27 slow-seeded endpoints to appropriate tiers (static->daily for
6h+ seeds, slow->static for 2h seeds).
2. Population exposure: moved computation client-side. The server
handler is pure math on 20 hardcoded countries, no reason for
network calls. Eliminates ~17.7M requests/week (20 calls per
page load -> 0).
3. Consumer prices: wrapped fetchAllMarketsOverview in a circuit
breaker so the combined 8-market result is cached as a unit.
Returning visitors within 30min hit localStorage instead of
firing 8 separate API calls.
* test: update shipping-rates tier assertion (static -> daily)
* test: update cache tier assertions for three-tier caching design
* fix(security): force slow-browser tier for premium endpoints
Premium endpoints (PREMIUM_RPC_PATHS + ENDPOINT_ENTITLEMENTS) must not
get public s-maxage headers. CF would cache authenticated responses and
serve them without re-running auth/entitlement checks. Force these to
slow-browser tier (browser-only max-age, no public/s-maxage).
* fix(security): add list-market-implications to PREMIUM_RPC_PATHS
PRO-only panel endpoint was missing from premium paths, allowing CF
edge caching to serve authenticated responses to unauthenticated users.
* chore: disable deduct-situation panel and endpoint
Panel set to enabled:false in panels.ts, server handler returns
early with provider:'disabled'. Code preserved for re-enabling later.
* fix(security): suppress CDN-Cache-Control for premium endpoints too
P1: slow-browser tier still had CDN-Cache-Control with public s-maxage,
letting Vercel CDN cache premium responses for same-origin requests.
Now CDN caching is fully disabled for premium endpoints.
P2: revert server-side deduct-situation disable. Keep backend intact
so the published API and correlation engine enrichment still work.
Only the panel is disabled (enabled:false in panels.ts).
0 commit comments