Icon

Including device type in the cache key ensures that content is appropriately cached and served based on the user’s device. This enhances performance by delivering device-specific cached content, improving load times and user experience.

Loading...

https://www.edgecompute.live/edgeworkers/personalization/cachekeyDevicetype

Copied to clipboard!

This example includes the device type (tablet or mobile) from a PMUSER variable in the computed cache key for an Edge Server.

Icon landscape
Cache Integration

Combine performance benefits from CDN caching with dynamic edge compute logic.

Icon landscape
Device Heuristics

Customize dynamic behavior based on the user's device.

Related Examples

View More
Icon Card background
API Orchestration

Demonstrates how EdgeWorkers can be used to merge multiple internal APIs into a single API response from a user experience perspective.

View Case
Icon Card background
Device Routing

Implements modification of the forward origin path of the URL to return device-specific content.

View Case
Icon Card background
Dynamic Callback

Demonstrates how an EdgeWorker can wrap a JSON response with a dynamic unique callback function leveraging Response Provider and Stream API for efficient content transformation. The EdgeWorker should be enabled on JSON requests containing a callback query parameter, which can be managed via Property Manager. When such a request comes in, this EdgeWorker removes the callback query parameter, makes a sub-request to fetch the JSON data, and serves it as a stream. The EdgeWorker code adds a prefix with the callback function name captured from the query parameter and a suffix. Both JSON data and transformed data can be cached using standard ““Caching”” behavior in Property Manager if caching is allowed.

View Case