Mobile cache
The Mobile cache feature is used to serve fast pages to visitors who are using a mobile device to navigate your website.
This feature is activated by default upon activating WP Rocket.
This article includes some details of how the feature works, and other general instructions.
Feature overview
With the Mobile Cache feature, WP Rocket applies the page caching and all the additional optimizations to mobile devices.
WP Rocket will create a separate set of cache files for mobile devices. With this approach, any mobile-specific content will be cached and served independently.
Also, if the Preload cache option is active, the mobile-specific cache files will be generated in addition to the desktop-specific cache files.
How to check if Mobile Cache is working
If you visit the cache directory in /wp-content/cache/wp-rocket/yourdomain.com/, you should see the mobile-specific cache files:
index-mobile.html_gzipindex-mobile-https.html_gzip
If the WebP Compatibility option is enabled, the cache files have -webp appended to the filename:
index-mobile-webp.html_gzipindex-mobile-https-webp.html_gzip
Important! Check the hosting compatibility article to see if your hosting provider uses its own page caching option. In those hosting companies, WP Rocket's cache folder will be empty.
Treat tablets as mobile
By default, the Mobile Cache feature works on phones only. It does not consider tablets as “mobile” in the context of page caching, therefore, the default cache (for desktop) will be served to tablet devices.
You can modify this default behavior to treat tablets as mobile with this helper plugin:
📥 Download (.zip): WP Rocket | Set tablets as mobile
Developers: you can find the code for this plugin on GitHub.
The helper can be useful if your theme or plugin uses the wp_is_mobile() function, which treats tablets as mobile devices.
How to deactivate this feature
If you have issues, and you need to deactivate this option, you can use the following helper plugin:
📥 Download (.zip): WP Rocket | Customize Mobile Cache Options
Developers: You can find the code for this plugin on GitHub.
Upon activation, this helper will:
Deactivate the mobile-specific cache, so mobile devices will receive the default (desktop) cache instead.
- Deactivate the Optimize Critical Images, Automatic Lazy Rendering and Preconnect to external domains features, as it's not safe to optimize the critical images, below the fold elements, or the critical fonts, without taking into account the device type
And if needed, you can also further customize this helper plugin to:
- Deactivate the Mobile Cache option altogether, by uncommenting the line 35, as shown here.
Risks of deactivating the mobile-specific cache
Deactivating the mobile-specific cache can potentially cause issues if you have mobile-specific content on your site.
The following problems within WP Rocket options can occur:
- Remove Unused CSS: Mobile-specific issues
- Optimize critical images: Known conflicts and Automatic Lazy Rendering: Known Conflicts - If you're not using the WP Rocket | Customize Mobile Cache Options helper plugin.
Also, any custom or third-party feature that depends on the wp_is_mobile() function may be affected.
How to activate this feature if it's disabled
If the Mobile Cache option is somehow deactivated, you can go to the Tools tab, and click on the Mobile Cache > Enable Mobile Cache option, as shown here:

This is a one-time action, so, once you've clicked on the Enable Mobile Cache button, the Mobile Cache section will disappear from the Tools tab.
Please note that when using the option in the Tools tab to activate the Mobile Cache option, its default behavior of creating mobile-specific cache will be enabled too.
Additional cache layers
If you are using an additional layer of cache, such as Varnish, NGINX, Cloudflare's Cache Everything, etc., that is not configured to distinguish between mobile and desktop visitors, then you may run into these problems:
- Wrong display for mobile, tablet or desktop
- Remove Unused CSS: Mobile-specific issues
- Optimize critical images: Known conflicts
- Automatic Lazy Rendering: Known conflicts
To avoid this type of issues, it's recommended to deactivate those additional layers of cache, and let WP Rocket handle caching for desktop and mobile.
Hosting providers managing page caching
Some hosting providers with automatic compatibility manage the page caching themselves instead of using WP Rocket's caching.
Among those compatible hostings providers, WP Engine and Kinsta are known to be configured to have a separate cache for mobile, therefore, the layout issues related to additional layers or cache shouldn't happen.
However, this is not the case for all hosting providers. So, in case you have issues with hosting providers that manage page caching (instead of WP Rocket), you should reach to their support team, ask if their page caching is configured to separate device types, and request further guidance.
Cloudflare APO
When using Cloudflare APO, please make sure to enable their caching by device type option.
For more information about the compatibility between WP Rocket and Cloudflare APO, please check this guide.
Technical details
- Mobile phones get detected by the HTTP user agent. You can find the complete set of user agents WP Rocket will detect and treat as mobile in this file.