• Resolved TristanQ

    (@tristan29)


    Hi there !

    I recently noticed that Cloudflare is no longer serving pages based on device-specific caching. I had been using the setup described in this GitHub thread, which worked perfectly until now. However, it recently stopped functioning as expected—for instance, the desktop menu is now being served on mobile devices.

    My setup includes the library Mobile-Detect-3.74, which relies on headers to determine the device type. Upon investigation, I found that pages served by Cloudflare no longer include the x-cf-device-type header. Additionally, in Cloudflare’s cache rules, the option to serve this header information appears to be disabled (as shown in this screenshot) and is only available with the Enterprise plan.

    That said, I noticed that the toggle option for caching by device type is still present in the settings. Could you confirm if the “cache by device type” feature is still functional?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Kush

    (@kushnamdev)

    Hi @tristan29,

    The guide you used is no longer relevant to the latest version of the plugin, as the feature has been removed. We are now using cache rules instead of page rules, as it is a better approach compared to before.

    To remain up to date with the latest setup, please follow these steps:

    1- Logout your cloudflare account from the plugin.
    2- Reconnect it to the plugin using your email and global API key.
    3- Select the domain of your site.

    Wait for a few seconds and then click on test cache button.

    Please let us know how it goes, thank you!

    Thread Starter TristanQ

    (@tristan29)

    Thanks a lot for your response, I followed your recommendations, but unfortunately it did not work…

    The “cache by device type” in the cache rule is not effective : On mobile, my desktop menu is still served.

    I tried to disable disk cache, and other settings but nothing worked.

    Plugin Support Kush

    (@kushnamdev)

    Hi @basswoelfe,

    Thank you for your message.

    The “Cache by device type” feature relies on Cloudflare’s ability to detect and vary caching based on the user-agent. If you’ve noticed changes in behavior, please ensure that the feature is still enabled in the plugin settings and that Cloudflare’s configuration hasn’t changed recently (e.g., disabling device type caching or modifying edge cache behavior).

    We’ll continue to monitor this, and your feedback is valuable in helping us ensure continued compatibility. Additionally, you can try contacting cloudflare support team as well.

    Best regards,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Cache by device type not working anymore’ is closed to new replies.