Cache::get / Cache::set
Posted: Tue Jul 01, 2025 9:54 am
Your Build 202506220800 (Current build: 202506220800 )
Code: Select all
if ((int) '<!--GALLERY_ID-->') {
$last_items = Cache::get('last_items');
if (!$last_items) $last_items = array();
if ($last_items[0] != (int) '<!--GALLERY_ID-->') array_unshift($last_items, (int) '<!--GALLERY_ID-->');
$last_items = array_slice($last_items, 0, 100, true);
Cache::set('last_items', $last_items, 3600);
}Пробую и в кастомных шаблонах, и в стандартных - Cache::set(...) возвращает true, но при этом Cache::get() возвращает пустоту.
При этом если делаю через свой класс, типа,
Code: Select all
if (class_exists("Redis")) {
$core_redis = new Redis();
$core_redis->connect($config["redis_host"], $config["redis_port"], 0.5);
if ($config["redis_password"]) {
$core_redis->auth($config["redis_password"]);
}
$core_redis->select($config["redis_database"]);
...
$core_redis->set($key, $value, $ttl);
...
$core_redis->get($key);
}
Я бы и использовал дальше самопис, но непонятно как выдирать для <thumb num=1-30 limit_by_gallery_id=true gallery_id=CACHE_GET_cache_key></thumb> данные.
там же явно нельзя в thumb передать напрямую нужные айдишники...