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:

  1. The CDN detects the device type using the User-Agent header.

  2. The CDN assigns a unique cache key that includes the device classification.

  3. The edge forwards the X-DEVICE and X-MOBILE headers to the origin.

  4. The origin can log, analyze, or conditionally serve device-aware responses.

Access or Enable the Feature

The Mobile Device Cache setting is set to Off by default.

  1. In the Medianova Control Panel, navigate to your CDN Resource.

  2. Click the Caching tab.

  3. Scroll to the Mobile Device Cache setting.

  4. 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?