Mobile Device Cache
Enable device-specific caching to ensure optimized content delivery for mobile, tablet, or desktop users.
The Mobile Device Cache feature, available under CDN → Caching, enables device-specific caching for Dynamic CDN resources. By storing separate cache entries for mobile, tablet, and desktop devices, this feature ensures that users receive content optimized for their specific device type, eliminating cache conflicts across different device categories.
When enabled, the system adds two headers to each request:
X-DEVICE: Identifies the device type (e.g.,
mobile,tablet,desktop).X-MOBILE: A boolean indicator (
true/false) of whether the device is mobile.
These headers are forwarded to the origin to allow dynamic content adaptation.
Use Case
Enable this setting if your website delivers different HTML, layout, or assets depending on the device type. This ensures:
Accurate cache segmentation (no desktop HTML served to mobile clients).
Reduced layout shift and rendering issues.
Improved user experience and consistency across devices.
How It Works
When a request reaches the CDN edge:
The CDN detects the device type using the User-Agent header.
The CDN assigns a unique cache key that includes the device classification.
The edge forwards the X-DEVICE and X-MOBILE headers to the origin.
The origin can log, analyze, or conditionally serve device-aware responses.
A request from an iPhone is classified as 'mobile'. The cache key becomes /index.html|mobile, and the system adds headers: X-DEVICE: mobile and X-MOBILE: true.
Access or Enable the Feature
The Mobile Device Cache setting is set to Off by default.
In the Medianova Control Panel, navigate to your CDN Resource.
Click the Caching tab.
Scroll to the Mobile Device Cache setting.
To enable, switch the setting to On.
Headers Reference
Header
Description
Example
X-DEVICE
Device type detected by the CDN.
mobile / tablet / desktop
X-MOBILE
Boolean indicator for mobile device classification.
true / false
Limitations
This feature relies on User-Agent detection; edge classification may not be 100% accurate for all custom or rare user agents.
The feature does not support per-resolution caching (e.g., for responsive images by screen width).
Best Practices
Use this feature in combination with responsive design or server-side device detection logic.
Avoid excessive variation; only enable if content materially differs across device types.
Monitor cache hit ratios before and after enabling the setting
Last updated
Was this helpful?