Title: [Plugin: WP Super Cache] Different cache files for different mobile devices?
Last modified: August 19, 2016

---

# [Plugin: WP Super Cache] Different cache files for different mobile devices?

 *  [nathanadams](https://wordpress.org/support/users/nathanadams/)
 * (@nathanadams)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-different-cache-files-for-different-mobile-devices/)
 * Is there a way of having the ‘mobile device support’ deal with multiple mobile
   devices?
 * I serve up different theme for iPad to what I server up to iPhone (so 3 themes
   in all, desktop, ipad and iphone). I’ve added iPad to the list of mobile devices
   in the wp-cache.php file, which includes the iPad as a mobile device. However,
   wp-super-cache seems to group all mobile devices together – so both iPad and 
   iPhone display the same cached files (what theme it gets depends on which device
   viewed the page first). Obviously not the intended result.

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

 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-different-cache-files-for-different-mobile-devices/#post-1678471)
 * Yes, look in wp-cache.php for “ipod” and check out the filters on those arrays.
   You can have an “ipod” group so those devices get their own cache file.
 * Don’t modify wp-cache.php directly, use the filters!
 *  Thread Starter [nathanadams](https://wordpress.org/support/users/nathanadams/)
 * (@nathanadams)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-different-cache-files-for-different-mobile-devices/#post-1678533)
 * Sorry for my ignorance, but how do I use the filters?
 * I tried to change line 450 from
    `// mobile_groups = array( 'apple' => array('
   ipod', 'iphone' ), 'nokia' => array( 'nokia5800', 'symbianos' ) );` to `// mobile_groups
   = array( 'apple' => array( 'ipod', 'iphone' ), 'ipad' => array ( 'ipad ), 'nokia'
   => array( 'nokia5800', 'symbianos' ) );` but no affect. iPad and iPhone are still
   accessing the same caches as eachother.
 * Or am I looking in completely the wrong place?
 * Thanks for your help.
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-different-cache-files-for-different-mobile-devices/#post-1678534)
 * You’ve still got “ipod” in the “apple” group! 🙂
 * You should use the “cached_mobile_groups” filter rather than changing wp-cache.
   php to make upgrading the plugin easier.
 *  Thread Starter [nathanadams](https://wordpress.org/support/users/nathanadams/)
 * (@nathanadams)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-different-cache-files-for-different-mobile-devices/#post-1678535)
 * Ahhh, ok! It should have occurred to me that the ‘ipod’ would cover both iphone
   and ipad. I changed it in the wp-cache.php file, and it seems to be doing what
   I want now.
 * If I want to use the cached_mobile_groups filter, rather than editing the wp-
   cache.php file as you say, where would I find that?
 * Cheers!
 *  [Nathan Adams](https://wordpress.org/support/users/nathan-adams/)
 * (@nathan-adams)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-different-cache-files-for-different-mobile-devices/#post-1678536)
 * Looks like I spoke too soon. After waiting a bit and checking again later, now
   the iPad version and the main desktop version are getting mixed up with each 
   other.
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-different-cache-files-for-different-mobile-devices/#post-1678537)
 * My mistake, I thought you had ipod in both arrays, not ipod in one and ipad in
   the other.
 * Using filters is complicated, best [use Google](http://www.google.ie/search?sourceid=chrome&ie=UTF-8&q=wordpress+using+filters)
   and research it as it’s important to know if you’re modifying things!
 * The only way to figure this out is by exhaustively debugging it unfortunately.
   Look for the mobile code in wp-cache-phase1.php and log what that returns, and
   you’ll probably have to debug wp-touch too to make sure that returns the right
   template the first time.
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-different-cache-files-for-different-mobile-devices/#post-1678538)
 * I looked in the code in wp-cache-phase1.php – you need both useragents, ipad 
   and iphone in the mobile browser list before the code checks the groups. The 
   iPad isn’t there by default. Does that help?
 *  [Nathan Adams](https://wordpress.org/support/users/nathan-adams/)
 * (@nathan-adams)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-different-cache-files-for-different-mobile-devices/#post-1678539)
 * Unfortunately, as soon as you add iPad to the mobile browser list, it goes back
   to mixing up the iphone and ipad versions again.
 * Maybe the issue is that I’m not using wp-touch for the alternative themes, but
   instead Mobile Theme Switcher (It’s the only one I’ve been able to find that 
   lets you independently pick alternate themes for ipad and iphone). Obviously 
   doesn’t want to play nice with WP Super Cache.
 * I think fiddling around with filters might be a bit beyond my skill set at this
   stage. It’s certainly gone on my to-do list to learn though 😉
 * Cheers.

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

The topic ‘[Plugin: WP Super Cache] Different cache files for different mobile devices?’
is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

## Tags

 * [different](https://wordpress.org/support/topic-tag/different/)
 * [iphone](https://wordpress.org/support/topic-tag/iphone/)
 * [mobile](https://wordpress.org/support/topic-tag/mobile/)
 * [multiple](https://wordpress.org/support/topic-tag/multiple/)

 * 8 replies
 * 3 participants
 * Last reply from: [Nathan Adams](https://wordpress.org/support/users/nathan-adams/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-different-cache-files-for-different-mobile-devices/#post-1678539)
 * Status: not resolved