wptouch logo

WPtouch

Mobile Suite for WordPress

Optimizing Caching Plugins for Mobile Use

Note: The notification in the Notifications area will not go away automatically when the cache plugin has been configured properly. When the cache plugin has been properly configured, you may manually dismiss the notification by clicking on the ‘x’ icon when hovering over the notification.

Caching software is used to improve the performance of your website. Unless the caching software has been specifically developed for use with mobile devices, it may override WPtouch Pro and give the appearance that your mobile theme is not functioning. You may see:

  • Cached posts and pages using your desktop theme on mobile devices, and/or
  • Cached posts and pages using your mobile theme on desktop devices.
  • Inconsistency of theme when your site is refreshed.

Fortunately, most caching plugins and services may be optimized for mobile use by disabling caching when mobile devices are detected.

  • BraveNewCode’s Infinity Cache extension may be used in conjunction with other caching plugins or may be used as a replacement for traditional caching plugins.
  • When using multiple caching plugins, disable the setting to “Create cache for desktop users” in Infinity Cache. Be sure to follow these setup guidelines for best performance of your caching plugin.
  • Because mobile sites are often not as content- and feature-heavy as their desktop counterparts, using caching in your mobile theme generally does not provide a significant boost to page load times. Disabling caching is unlikely to have any significant effect on the page load times of your mobile website.

Hyper Cache

Hyper Cache is a caching plugin that offers support for mobile devices. It will cache your mobile pages under a different name. To enable mobile device support, enable “Detect mobile devices” in the Hyper Cache settings then in the “Mobile agents list” enter the list of user agents found in our list of “User agent list for configuring cache plugins“.

If you do not want your mobile pages cached, disable “Detect mobile devices” then scroll down to the “Agents to reject” list and enter the list of mobile user agents below. Scroll back up and click “Clear cache” to get rid of pages that were cached before adding the rejected user agents.

Note: The notification in the Notifications area will not go away automatically when the cache plugin has been configured properly. When the cache plugin has been properly configured, you may manually dismiss the notification by clicking on the ‘x’ icon when hovering over the notification.

Quick Cache Pro

In the Quick Cache Pro Config Options, expand “User-Agent Exclusion Patterns” and enter the list of mobile user agents found in our list of “User agent list for configuring cache plugins“.

Note: The notification in the Notifications area will not go away automatically when the cache plugin has been configured properly. When the cache plugin has been properly configured, you may manually dismiss the notification by clicking on the ‘x’ icon when hovering over the notification.

W3 Total Cache

If you have “Browser Cache” enabled, please disable ‘Set expires header’ in the Browser cache settings to prevent Desktop/Mobile switch link issues.
  1. Go to the “Page Cache” settings under the Performance tab.
  2. Copy the list of mobile user agents found in our list of “User agent list for configuring cache plugins“.
    If you have added support for additional mobile devices in WPtouch Pro’s Compatibility > Custom User Agents field, you must also include those user agents in the “Rejected User Agents” area in W3 Total Cache.
  3. Scroll down to the “Rejected User Agents” field and paste the list of WPtouch default user agents, adding one per line.
  4. Save your changes.
  5. Go to the “Minify” settings under the Performance tab.
  6. Scroll down to the “Rejected User Agents” field and paste the list of WPtouch default user agents, adding one per line.
  7. Save your changes.
  8. Go to the “CDN” settings under the Performance tab.
  9. Scroll down to the “Rejected User Agents” field and paste the list of WPtouch default user agents, adding one per line.
  10. Save your changes.
  11. Finally, go to the W3 Total Cache “Dashboard” and select “Empty All Caches”.
Note: The notification in the Notifications area will not go away automatically when the cache plugin has been configured properly. When the cache plugin has been properly configured, you may manually dismiss the notification by clicking on the ‘x’ icon when hovering over the notification.

Your site should now be configured correctly to work with WPtouch Pro and W3 Total Cache.

If you are running a version of W3 Total Cache released before version 0.9.2.9, you will need to add the wptouch-pro-view cookie in the “rejected cookies” area in the Page Cache settings.
exclude-wptouch-pro-cookie

Exclude WPtouch Pro Cookie

WP Simple Cache / WP Green Cache

Contains no options to enter user agents to reject. Current version does not play well with WPtouch Pro.

WP Super Cache

The native support for the free version of WPtouch found in WP Super Cache (under the “Plugins” tab) must be disabled to prevent conflicts in WPtouch Pro.
  1. Enable Mobile device support.
    In the Advanced tab of the WP Super Cache settings select “Mobile Device Support”* and click “Update Status”.
  2. Exclude mobile user agents.
    Still in the Advanced tab, scroll down to the “Rejected User Agents” area. Paste the entire list of mobile user agents found in our list of “User agent list for configuring cache plugins” into the field and click “Save UA Strings”.
    Please note: If you have added support for additional mobile devices in WPtouch Pro’s Compatibility > Custom User Agents field, you must also include those user agents in the “Rejected User Agents” area in WP Super Cache.
  3. In the “Contents” tab, click “Delete Cache”  and “Delete Expired” to delete pages that were likely cached before adding the new list of rejected user agents.
Note: The notification in the Notifications area will not go away automatically when the cache plugin has been configured properly. When the cache plugin has been properly configured, you may manually dismiss the notification by clicking on the ‘x’ icon when hovering over the notification.

WP Super cache should now be configured correctly to ignore mobile user agents while still caching pages viewed on a desktop browser.

  • Enabling “Mobile Device Support” alone seems to cache and serve mobile page separately to mobile devices. If you are seeing issues where mobile pages are being shown in your desktop browser or vice-versa, please apply all the settings outlined above.
  • If you’ve configured WP Super Cache and caching issues persist, try manually removing all cached files from your server via FTP.

WPEngine

Please contact WPEngine and ask them to exclude the user agents found in the “User agent list for configuring cache plugins“.

Wordfence

Go to the “Performance Setup” in the Wordfence settings and select “User-Agent Contains”. Enter the user agents in the “User agent list for configuring cache plugins“ list one at a time.

Then, select “Cookie Name Contains”, enter wptouch_switch_toggle and click the Add Exclusion button.

Autoptimize

    1. Enable the Advanced settings in Autoptimize.
    2. Add webapp.js in the “Exclude scripts from Autoptimize” field
    3. Click the “Save changes and Empty Cache” button.

Sucuri

The Sucuri plugin includes a caching feature that can be disabled in the “Performance” tab, to avoid caching conflicts with WPtouch Pro.

Other Caching Plugins or Services

In general, caching may be disabled for mobile devices by instructing the plugin or service not to cache pages nor serve cached pages when devices on the WPtouch Pro list of mobile user agents (“User agent list for configuring cache plugins“) are encountered. If there is no “rejected user agents” area or similar, contact the plugin’s developer or the service’s support department for assistance.

If you have added additional mobile user agents to WPtouch Pro, be sure to include those when optimizing for mobile use.

2