How to: Prevent Jetpack’s mobile theme or WPtouch to get cached by W3 Total Cache
But getting back on topic: W3 Total Cache is not smart enough to handle this situation. The recommendation here is to indicate W3 Total Cache to not cache pages served to mobile clients. Now, in my case only a small percentage of my visitors come from a mobile device and my server even without cache is able to serve pages at an acceptable speed. If your case is different and you need cached pages for mobile visitors then consider changing to another plugin like WP Super Cache.
If you wish for mobile devices to not get cached pages then you need to leverage the user agents feature to exclude them in W3 Total Cache. This means that Page Cache, Minify and CDN need to be configured to exclude mobile devices.
A new feature in the latest release called “User Agent Groups” also provides further flexibility to address this issue. It comes with pre-loaded groups that identify High End clients and Low End clients. Take for example any IOS device is considered a High End client as the browser can render comparably with a full featured desktop browser. This new feature allows W3 Total Cache to serve different cached pages: One default cache and One cache for each User Agent Group.
So my recommendation is to use this feature to address the issue with mobile themes getting cached for all clients. In order to activate this follow this simple instructions:
- Go to the User Agents Group setting under the Performance tab
- Scroll to each Group and Enable both default groups
- You might get an error when you save indicating that “bb10” is in both lists. Simply remove it from one of them… I want to believe it is more of a High end client, but who knows. Once you remove it from one of the lists you can save and be done!
- The Theme section should be left to — Pass-through — if you are using JetPack’s Mobile Theme (currently known as minileven). If you have another theme installed you want to use you may select it from the list.
If you are using a previous version simply disable a few User Agents as mentioned previously. People like to use the previous version as some things work better on it. Below are the instructions you can follow:
- Go to the Page Cache settings under the Performance tab
- Scroll down to the Rejected user agents box and paste the user agents you want to exclude. Below are a few suggestions. Save changes.
- Go to the Minify settings page under the Performance tab
- Scroll down to the Rejected user agents box and enter the user agents you want to exclude. Below are a few suggestions. Save changes.
- Go to the CDN settings page under the Performance tab
- Scroll down to the Rejected user agents box and again enter the user agents you want to exclude. Below are a few suggestions. Save changes.
- Finally, go to the General Settings page under the Performance tab and click empty all caches.
Suggested user agents to exclude:
User Agents included in the High End list:
t-mobile mytouch 3g
User Agents included in the Low End list: