TOPIC: How to unite phone & iphone cache?

How to unite phone & iphone cache? 20 Jan 2017 06:43 #1862

Good day! Thanks for very useful extention!

How to unite phone & iphone cache? Now, in my system three kind of cache: common, phone and iphone. But I need only two: mobile (for phone and iphone) and common (for all others).

Joomla version : 3.6
JotCache version : 5.3.2
site template:
system plugins :
The administrator has disabled public write access.

How to unite phone & iphone cache? 20 Jan 2017 08:39 #1863

Your settings are well set for cache: common, phone and iphone. In standard JotCache is not possible to set one group for (iphone,phone).
The administrator has disabled public write access.

How to unite phone & iphone cache? 20 Jan 2017 10:37 #1864

Thanks for your answer.
I do it with some hardcode:
in \plugins\system\jotcache\jotcache\UserAgentStringParser.php
on line 24
'browser_name' => 'IPhone',
change to
'browser_name' => 'phone',
and it works fine.
The administrator has disabled public write access.

How to unite phone & iphone cache? 20 Jan 2017 10:40 #1865

Yes, it is very good solution.
The administrator has disabled public write access.

How to unite phone & iphone cache? 03 Feb 2017 09:45 #1871

May be it will be useful for somebody.

Jotcache use github.com/ornicar/php-user-agent for detection different browsers. But joomla has own class for detection. So, if you need only mobile/desktop version of cache (as for me) you can rewrite function getBrowser() in \plugins\system\jotcache\jotcache.php
protected function getBrowser() {
$browser = '';
$client = new JApplicationWebClient();
$isMobile = $client->mobile;
if($isMobile){
$browser='phone';
}else{
$browser='';}
return $browser;
}

Also, I use small plugin for switching templates. I think, it would be useful to add this functional to jotcache.

Joomla version : 3.6
JotCache version :
site template:
system plugins :
The administrator has disabled public write access.
Time to create page: 0.299 seconds
We have 59 guests and no members online
Copyright © 2015 JotComponents
We have 59 guests and no members online
Copyright © 2018 JotComponents