Demonstrate edge-side A/B testing using Cloudflare Snippets
Enable or disable the A/B testing snippet. When enabled, visitors to /demo will be randomly assigned to variant A or B with persistent cookie tracking.
Cloudflare Snippets run at the edge before your origin is reached. This demo shows how to use snippets for A/B testing:
Snippets are lightweight JavaScript functions that run at Cloudflare's edge, allowing you to modify requests and responses before they reach your origin or users.