Shadow Release
Use Case
Section titled “Use Case”Mirror production traffic to a new upstream version without affecting user responses.
Recipe
Section titled “Recipe”{ path: "/v1/orders/*", methods: ["GET", "POST", "PUT"], pipeline: { policies: [ trafficShadow({ target: "https://orders-v2.internal.example.com", percentage: 10, methods: ["POST", "PUT"], timeout: 3000, }), ], upstream: { type: "url", target: "https://orders-v1.internal.example.com", }, },}Why it works
Section titled “Why it works”- Primary responses still come from stable v1.
- v2 receives realistic traffic for verification.
- Shadow failures do not impact users.
Operational tip
Section titled “Operational tip”Use the adapter waitUntil capability in Cloudflare (cloudflareAdapter({ executionCtx })) so shadow requests continue even after the primary response is returned.