ogdev/bitrix-rest-api-cache

There is no license information available for the latest version (dev-master) of this package.

Библиотека для кеша приложения основенного на апи

Installs: 166

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 2

pkg:composer/ogdev/bitrix-rest-api-cache

dev-master 2025-10-09 13:59 UTC

This package is not auto-updated.

Last update: 2025-10-09 14:07:59 UTC


README

Для подключения кеша редиса к битриксу нужно:

  1. Установить зависимость composer require ogdev/bitrix-rest-api-cache
  2. В файл bitrix/php_interface/dbconn.php подключить автолоадер require($_SERVER['DOCUMENT_ROOT'] . "/local/php_interface/vendor/autoload.php");
  3. Добавить настройки подключения редиса в файл bitrix/.settings_extra.php (пример в папке examples)
  4. Вызов кеша в контроллере
$cache = new PhpCache($this->getRequest());
$cacheResult = $cache->init();
if (!$cacheResult) {
    // кешируемый вызов
    // $result = ['test' => 1];
    if ($result) {
        $cache->addTag('test');
        $cacheResult = new TestResponse();
        $cache->cache($result);
    }
}