bitrix-caching

Implement multi-layer caching strategies for Bitrix applications.

33|3|Updated Jun 5, 2025
One-click install
npx skills add https://github.com/bxmaximum/bitrix_ai_challenge --skill bitrix-caching
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bitrix-caching
Source: https://github.com/bxmaximum/bitrix_ai_challenge/tree/main/.agents/skills/bitrix-caching
Command: npx skills add https://github.com/bxmaximum/bitrix_ai_challenge --skill bitrix-caching

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bitrix apps can suffer from excessive database queries and rendering overhead. This Skill provides layered caching strategies to dramatically reduce latency, improve response times, and simplify cache invalidation across components, ORM data, and composite pages.

Core Features & Use Cases

  • Unmanaged cache (Bitrix\Main\Data\Cache) for time-bounded results.
  • ManagedCache and TaggedCache for longer-lived or group-invalidated data.
  • ORM caching via isCacheable() and getList cache options.
  • Component caching with startResultCache/endResultCache and CACHE_* parameters.
  • Composite cache for full-page performance and cache warm-up.
  • Cache engine configuration in .settings.php (files, memcached, redis).
  • Invalidation strategies via events and tags to maintain correctness.

Quick Start

Configure a cache engine in .settings.php, then wrap critical components with startResultCache/endResultCache to enable caching.

Frequently Asked Questions about bitrix-caching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce excessive database queries in Bitrix components?

Reduce Bitrix database queries by wrapping critical components with startResultCache and endResultCache to enable component caching. This prevents redundant data fetching on repeated requests and significantly lowers rendering overhead.

What is the difference between managed cache and tagged cache in Bitrix?

ManagedCache in Bitrix provides time-bounded caching for standard results, while TaggedCache enables group-based invalidation. Tagged cache allows you to clear cached data across multiple components simultaneously when underlying data changes via specific tags.

How do I configure memcached or redis for Bitrix cache engines?

Configure memcached or redis cache engines in the .settings.php file. Defining the cache engine configuration here allows Bitrix to route caching operations to your preferred high-performance storage instead of default file-based caching.

Can I cache Bitrix ORM query results automatically?

Yes, you can cache Bitrix ORM query results by setting the isCacheable method to true and configuring getList cache options. This allows the ORM to store query outputs and serve them directly on subsequent identical requests.

What is the best way to invalidate Bitrix cache when data changes?

The best way to invalidate Bitrix cache is using tag-based invalidation strategies via events. By assigning tags to cached data, changes in underlying records trigger events that automatically clear only the affected cache entries.

When should I use Bitrix composite cache over component caching?

Use Bitrix composite cache for full-page performance when you need to cache entire page outputs, and use component caching for individual data blocks. Composite cache requires careful integration but supports cache warm-up for high traffic.