0
votes

I'm new to drupal and I have an issue with drupal6 caching system. I have enabled drupal cache and it will refresh the cache for every 5 mins. I have couple of themes for my site. One for normal desktop users and another one for mobile users. Now the problem is once I open the site from mobile for the next 5 mins the mobile theme is caught by drupal cache and the same is sent to desktop request also. Even though I open the site from desktop it self I can view the pages of mobile theme only. After clearing cache manually or after 5 mins I can view the desktop theme.

$useragent = $_SERVER['HTTP_USER_AGENT'];

I used this function to get the media type.

If any one already faced this issue please help me to come out of this issue.. thanks..

1

1 Answers

0
votes

You can try this module http://drupal.org/project/mobile_tools to switch templates for mobile and desktop users.

In your case code which detect user agent also cached. So it always (during 5 mins) shows you or mobile or desktop template.