Cache by Device Type for wordpress


I am not sure if I should activate it on wordpress.
I use APO plugin and there is a warning says
" Note: Changing Cache By Device Type setting will invalidate Cache. The setting is applied to all hostnames"

Is it good or bad?

Cache by Device Type

APO cache by device type allows you to cache content by device type. This allows all the benefits of Cloudflare’s cache while targeting visitors with content appropriate to their device. Cloudflare evaluates the User-Agent header in the HTTP request to identify the device type. We identify each device type with a case insensitive match to the regex below:

  • Mobile: (?:phone|windows\s+phone|ipod|blackberry|(?:android|bb\d+|meego|silk|googlebot) .+? mobile|palm|windows\s+ce|opera\ mini|avantgo|mobilesafari|docomo)
  • Tablet: (?:ipad|playbook|(?:android|bb\d+|meego|silk)(?! .+? mobile))
  • Desktop: Everything else not matched above.

To enable caching by device type either navigate to dashboard’s APO card or in Cloudflare for WordPress plugin version 3.8.7 or later .

Once enabled, Cloudflare sends a CF-Device-Type HTTP header to your origin with a value of either mobile , tablet , desktop for every request to specify the visitor’s device type.

If your origin responds with the appropriate content for that device type, Cloudflare caches the resource only for that specific device type.

Please note: Changing Cache By Device Type setting will invalidate Cache.

Cloudflare for WordPress plugin will automatically purge all cache variations for updated pages.

Please refer to the Plugins Compatibility section below to see the list of plugins that require enabling APO Cache By Device Type.

If you change that setting, it will purge your the entire cache of your zone. Not terrible, but necessary so it can rebuild the cache for the different device types.

However, if your site is responsive, and doesn’t serve different HTML for different devices, then there’s no need to activate this feature.

1 Like

Thanks for quick reply.
my web site is
It is responsive as far as i know.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.

You don’t need Cache by device feature if you serve same HTML/CSS on mobile/desktop devices.