Routing requests based on the device type at the edge ensures that users receive content optimized for their specific device. This enhances user experience by delivering device-appropriate content efficiently and reduces the load on the origin server.
Loading...
https://www.edgecompute.live/edgeworkers/personalization/forwardDevicetype
Copied to clipboard!
Implements modification of the forward origin path of the URL to return device-specific content.
Device Heuristics
Customize dynamic behavior based on the user's device.
Ease Development
Enable developers to modify application behavior without touching origin server logic.
Related Examples
View MoreA/B Testing
Randomly assigns a new user to a group for A/B testing. The assignment is stored in a cookie and passed to the origin in a query parameter. The A/B group can be forced via a query string parameter for easy testing. The group names, percentage split, cookie name, and query parameter name are configured through constants in the EdgeWorker JavaScript module.