With the growing number of mobile devices out there and considering that it is the fastest growing market I wanted to bring up some points about how drupal currently deals with mobile devices. Currently I use mobile tools to detect mobile devices and feed it a different theme based on what it detects. The drawback to this is that if you don't turn off caching you will get the mobile site showing up on your desktop device and vice versa depending on what css style sheets are saved in the cache. I'm not a 100% on my diagnoses so feel free to correct me if I'm wrong. If this is the case how hard is it to create seperate caches for each device? is this a core issue or an issue with mobile tools. it seems to me that with the growing number of devices that utilize the web that define themselves outside the traditional computer this is going to be an issue of increasing importance. Does this make sense? Am I being redundant here? Has someone already tackled this problem?

Comments

Anonymous’s picture

I think one solution is to keep separate domains for mobile & desktop.

www.domain.com
m.domain.com

Then using Domain Access with Mobile Tools, each domain should be cached properly. And you can even setup different Blocks/Views per domain.

mikebann’s picture

but then you have to build the site twice and your maintnace goes up to double the pain. Why is it that users can define different themes and they work fine but mobile tools can't redefine a theme without pulling from the same cache? It seems to me that the intelligence is already built into the framework it's just not utilized by mobile tools.

Your solution is valid it just creates a bunch of other issues.

Thanks

twom’s picture

Mobile Tools comes with a cache file: mobile_tools_cache.inc

This demonstrates how to overwrite the default cache keys... There is no generic solution to this problem in D6.

hash6’s picture

I would like to use themekey with Mobile Tools module in D6 to have seperate caching for each devices.
I looked in the mobile_tools_cache.inc file and checked the function

/**
 * Rewriting the cid support the usage of caching with mobile tools when using theme switching
 * for several device groups
 */
function cache_rewrite_cid(&$cid){
  require_once(dirname(__FILE__) . '/mobile_tools.module');
  $result =  _mobile_tools_is_mobile_device();
  $query = $_GET;
  unset($query['q']);
  $seperator = count($query) ? '&' : '?';
  $cid =  $cid . $seperator . 'mobile_group=' . $result['group'] . '&device=' . $result['type'];
}

Will using cache_rewrite_cid(&$cid) solve the problem alone?
or I would need to add something more to it to achieve unique caching for different devices.?

Jaypan’s picture

https://www.drupal.org/node/643758

You can move the thread by editing the original post and choosing 'Post Installation' as the forum.

Other users should start a new topic in that forum, rather than continuing in this forum.

Thank you.