PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Mobile Support

Quick Cache Plugin. Speeds up WordPress®.

Mobile Support

Postby mdalton » May 26th, 2010, 1:50 pm

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
User avatar
mdalton
Registered User
Registered User
 
Posts: 1
Joined: May 26, 2010

Re: Mobile Support

Postby Elizabeth » May 27th, 2010, 7:13 pm

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.
User avatar
Elizabeth
Moderator
Moderator
 
Posts: 160
Joined: May 12, 2010

Re: Mobile Support

Postby Jason Caldwell » June 21st, 2010, 7:45 pm

Marking this as resolved.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Mobile Support

Postby cyberskier » June 24th, 2010, 1:06 pm

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?
User avatar
cyberskier
Registered User
Registered User
 
Posts: 2
Joined: June 7, 2010

Re: Mobile Support

Postby Jason Caldwell » June 25th, 2010, 6:00 pm

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
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Mobile Support

Postby rrquinta » March 24th, 2011, 10:15 am

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. :)
User avatar
rrquinta
Registered User
Registered User
 
Posts: 1
Joined: March 24, 2011

Re: Mobile Support

Postby ovidiu » April 15th, 2011, 3:20 am

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
User avatar
ovidiu
Registered User
Registered User
 
Posts: 8
Joined: April 15, 2011

Re: Mobile Support

Postby newcomer » May 13th, 2011, 11:15 am

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:
User avatar
newcomer
Registered User
Registered User
 
Posts: 4
Joined: May 13, 2011


Return to Quick Cache Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron