We have just developed a mobile theme for our site and coded a very simple plugin to detect mobile users and redirect them accordingly. However, when Vboptimise is enabled, desktop guests will often see the mobile theme instead of the desktop theme. And sometimes mobile guests will see the desktop theme instead of the mobile theme.
This is obviously because of the full page caching for guests, but we don't want to disable that feature as it saves us quite a bit of load on our databases.
Our plugin is very simple. It is at the style_fetch hook
Is there some other place that we should be detecting the user's device at? style_fetch has always worked fine for us but it definitely doesn't work with full page caching enabled for guests.
This is obviously because of the full page caching for guests, but we don't want to disable that feature as it saves us quite a bit of load on our databases.
Our plugin is very simple. It is at the style_fetch hook
Code:
require 'mobile-detect/mobile-detect.php';
$mobile_detection = new Mobile_Detect;
if($mobile_detection->isMobile() && !$mobile_detection->isTablet()) {
$styleid = 10;
}
Is there some other place that we should be detecting the user's device at? style_fetch has always worked fine for us but it definitely doesn't work with full page caching enabled for guests.