Page 1 of 1

Mobile Support

PostPosted: May 26th, 2010, 1:50 pm
by mdalton
I'm using Wapple mobile architect plug-in for two sites (it authomatically detects most mobile platforms and switches themes) and Quick Cache seems to be ignoring the mobile version and just serving up the standard cache regardless. I know that WP cache adds some commands to either htaccess or wp-config to get around this. Anyone have any suggestions for using Quick Cache with Wapple?

PS - love Quick Cache! Much easier to use than WPSC

Re: Mobile Support

PostPosted: May 27th, 2010, 7:13 pm
by Elizabeth
This may help:

How can I serve a different set of cache files to iPhone users?

Set your MD5 Version Salt to the following:

((preg_match("/IPHONE/i", $_SERVER["HTTP_USER_AGENT"])) ? "IPHONES" : "")

This effectively creates two versions of the cache. When iPhone browsers are detected, Quick Cache will prepend IPHONES to the HTTP_HOST.REQUEST_URI, before it generates the MD5 hash for storage.

Re: Mobile Support

PostPosted: June 21st, 2010, 7:45 pm
by Jason Caldwell
Marking this as resolved.

Re: Mobile Support

PostPosted: June 24th, 2010, 1:06 pm
by cyberskier
This was a great tip, and did the trick for me to get Quick Cache to work with the WPTouch mobile. Any idea how also to get it to work with Android, Blackberry, and webOS?

Re: Mobile Support

PostPosted: June 25th, 2010, 6:00 pm
by Jason Caldwell
Here's what I would do:

Inside your /wp-config.php file, run all of your checks
against $_SERVER["HTTP_USER_AGENT"] in order to create a Salt.

So something like this:

Code: Select all
if(preg_match("/AvantGo|Android|iPhone|BlackBerry|Blazer|Cellphone|Danger|DoCoMo/i", $_SERVER["HTTP_USER_AGENT"])){
   define("MD5_VERSION_SALT", "mobile");
} else {
   define("MD5_VERSION_SALT", "others");
}

Then, for the MD5 Version Salt field inside the
Quick Cache options panel, just put in:
MD5_VERSION_SALT

This gives you greater flexibility and control over the way the Salt is being generated. For help with the preg_match() function, you can read this doc: http://php.net/manual/en/function.preg-match.php

Re: Mobile Support

PostPosted: March 24th, 2011, 10:15 am
by rrquinta
Hello,

I love your plugin - I just started using it and have already noticed much faster page loads overall. However, I'm having issues getting it to work with the mobile version of the site. We use WPtouch to auto-detect and load the mobile version of our site, and I tried doing the Salt code as you mentioned above. So far it seems to work fine with iPhone, but on Android devices, the regular version of the site is loading instead of the mobile version.

Is there a way to fix this? I also tried excluding Android from caching, and that didn't seem to help either.

Also, do you know if you can create this workaround for Windows 7 devices as well?

Any help in this would be appreciated. Thank you in advance. :)

Re: Mobile Support

PostPosted: April 15th, 2011, 3:20 am
by ovidiu
tried this in my quick cache md5 salt setting: ((preg_match("/Android/i", $_SERVER["HTTP_USER_AGENT"])) ? "Android" : "")

if you want to test and navigate here: http://zice.ro you can see the WP touch asking in the footer if you want to see the mobile version, if you click it, you still get redirected to the desktop site not the mobile version...

If I set up wp touch to display the mobile version straight away without asking the user it works. but if I click on an article to read it, it shows me the desktop version again... only the homepage seems to be displayed in mobile version

Re: Mobile Support

PostPosted: May 13th, 2011, 11:15 am
by newcomer
Hi ovidiu, may be you should create a new custom cookie by php like "mobile_user" when user change from mobile theme to normal theme, then salt cache with this cookie, so it won't display the mobile version when user switch from a mobile theme to general theme.

And if user stay with mobile theme, then just add the salt with mobile user_agent like you did it, it would cache the mobile version theme.

Hey, but does Quick Cache support salt like this : cookie?cookie:"".user_agent?user_agent:"".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] ? Maybe :roll:

Just some of my ideas :idea: