If you want to run a server-side A/B test, most CDNs support that out of the box:
- Akamai: Audience Segmentation Cloudlet or Edge Workers
- Amazon CloudFront: Functions or Lambda@Edge
- Cloudflare: Workers (see code example)
- Fastly: VCL or Fastly Compute
- Google Cloud CDN: App Engine
Test responsibly, friends.