Skip to content
Extraits de code Groupes Projets
Valider 2d2b8df3 rédigé par sgiehl's avatar sgiehl
Parcourir les fichiers

use eager instead of lazy cache for device detector, as cache should be more...

use eager instead of lazy cache for device detector, as cache should be more persistant as it can be used in each tracking request
parent 2672cbfe
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -28,7 +28,7 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\Cache ...@@ -28,7 +28,7 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\Cache
public function __construct($ttl = 300) public function __construct($ttl = 300)
{ {
$this->ttl = (int) $ttl; $this->ttl = (int) $ttl;
$this->cache = PiwikCache::getLazyCache(); $this->cache = PiwikCache::getEagerCache();
} }
/** /**
...@@ -47,6 +47,10 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\Cache ...@@ -47,6 +47,10 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\Cache
return self::$staticCache[$id]; return self::$staticCache[$id];
} }
if (!$this->cache->contains($id)) {
return false;
}
return $this->cache->fetch($id); return $this->cache->fetch($id);
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter