Closed (won't fix)
Project:
Mobile Tools
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
13 Dec 2010 at 13:37 UTC
Updated:
17 May 2012 at 21:32 UTC
Jump to comment: Most recent
I'm using mobile tools to do simple theme switching (no redirection). Everything works great until I enable normal caching. Then, either everything or nothing is switched to the mobile theme.
Basically, without caching mobile browsers get the mobile theme and desktops get the desktop theme. But, when I enable normal caching, desktop and mobile both get the same theme (sometimes mobile, sometimes desktop, I haven't determined exactly which to make it consistent).
Basically, this makes the mobile theme switching not usable with normal Drupal caching.
(I'm running the latest, Nov 28, dev.)
Comments
Comment #1
twom commentedHi,
This is a known problem and is not only related to mobile tools. When caching is enabled, mobile tools never get's the chance to do something.
However there is a fix, but I have not had the time to really elaborate on the solution.
The current solution is to overwrite the default caching with your own caching file. Have a look at mobile_tools_cache.inc. You basically have to add this to your settings file:
$conf['page_cache_fastpath'] = FALSE,
$conf['cache_inc'] = './sites/all/modules/mobile_tools/mobile_tools_cache.inc',
In the mobile_tools_cache, you will see that the cache id is overwritten...
Any help in testing this is welcome!
Comment #2
mbiddlecombe commentedthanks for this. can i ask whether the default performance cache settings should still be set to 'normal' or 'off'
Comment #3
twom commentedCaching should be off....
I am working on better solutions.
Tom
Comment #4
twom commentedhmm... Not completely true what I just said. There are two scenarios:
1) If you do only theme switching and your desktop and mobile site share the same url, then your caching should be off. The reason is that Drupal uses the url as key in the cache.
2) If you have a specific mobile url and a desktop url, then you can use caching.
It is recommended to have scenario 2, where you have a desktop an mobile url.... However, most projects have trouble when they want to create 2 mobile templates (high end and low end) on the same mobile url...
Adaptive design could be a solution for this.
Comment #5
twom commentedI did some extra testing and using
$conf['page_cache_fastpath'] = FALSE;
$conf['cache_inc'] = './sites/all/modules/mobile_tools/mobile_tools_cache.inc';
does the trick of theme switching if you enable caching.
Comment #6
Pentacor commentedThanks for that!
Comment #7
twom commented@Pentacor Thx for the feedback :)
Closing the issue now.
Comment #9
venusrising commentedWondering how good of an idea it is to mess with core caching?
Now if we have two urls like #2 would be have m.ourdomain DNS forward to same site url or how would that we set?
Would be need a whole other instance of Drupal installed or is this more of a redirect?
Thanks so much
Comment #10
minoroffense commented1.x branch is no longer supported. Closing.
Comment #11
saurabh.dhariwal commentedhttps://drupal.org/comment/7156456#comment-7156456 would be the best possible solution for this.