adrianmak Posted December 22, 2016 Share Posted December 22, 2016 I have a pw site which has two set of templates. One if for desktop another one is for mobile device I used a mobile detection library to load mobile template for mobile devices. Here is the code snippet in config.php require_once("mobile_detect.php"); $detect = new Mobile_Detect; $config->mobile = false; $config->prefix = "desktop"; if($detect->isMobile()) { $config->urls->templates = $config->urls->site . 'templates-mobile/'; $config->paths->templates = $config->paths->site . 'templates-mobile/'; $config->mobile = true; $config->prefix = "mobile"; } It's working fine without template cache enabled. If I enable a template cache, the mobile template is not working anymore. Mobile devices always load the cache of the desktop template. Link to comment Share on other sites More sharing options...
LostKobrakai Posted December 22, 2016 Share Posted December 22, 2016 That's to be expected. The template cache is just a quick way to cache pages of a specific template. It doesn't care about how the page is rendered. It identifies cache files just by the page id. If you need more control rather use WireCache. Link to comment Share on other sites More sharing options...
adrianmak Posted December 22, 2016 Author Share Posted December 22, 2016 if i want to mobile template and desktop template are both working with cache, how the wirecache could help me? could u please give me a little bit more details? Link to comment Share on other sites More sharing options...
adrianmak Posted December 24, 2016 Author Share Posted December 24, 2016 My problem has been solved from another post. Anyway, thank you @Can 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now