Thread Starter
abubin
(@abubin)
another question is…I thought memcache is used for caching database queries. Why it is causing frontend issue?
First of all: this is a full page cache. this means the full, rendered html is stored in the backend, which, in your case, is set to be memcached.
I do not deal with databse cache.
The only thing I work with in the plugin is the url. I have no idea how mobile detect works; to be able to look into it, please link the Mobile_Detect.php source code.
He probably is talking about this:
https://github.com/serbanghita/Mobile-Detect
I dont use that script, but I have the same issue. I am using this plugin: http://wordpress.org/plugins/any-mobile-theme-switcher/ to my visitors get a mobile theme, but because wp-ffpc caches the full page, the mobile users get a desktop page.
And if a mobile user get the correct page, the desktop user will see the mobile theme in your monitor.
I tried to use this piece of code, to avoid to cache mobile user agents, but it dont work. Maybe I need to put more user agents.
if ( $http_user_agent ~* '(ipad|ipod|iphone|android|opera mini|blackberry|pre/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine|iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile)' )
{
add_header X-Cache-Engine "Mobile User Agent Detected - No Cache";set $memcached_request 0;
}
that code could very much help, because a variable could be set both in nginx and in PHP based on it, which could be use to add an additional parameter to the cache key, as both the desktop and the mobile version could be cached.
I’ll try to come up with something nice for this in the next version.