A high-performance, multi-level caching system for Symfony applications. This bundle provides a flexible, extensible, and developer-friendly way to combine multiple cache backends (memory, Redis, file, etc.) for optimal speed and reliability.
It has two parts to it.
- The Multi Level Cache (MLC)
- The Cached Service Generator (CSG)
Of the two parts, the CSG is the intended way of using the MLC. But the MLC itself also has it's use cases and can be used directly without the CSG. Both are documented in sections bellow.
Install via Composer from GitHub:
- Require the package:
composer require tbessenreither/multi-level-cache
Tip
The following steps can be automated by using Copycat
- Enable the Bundle in
config/bundles.php:Tbessenreither\MultiLevelCache\MultiLevelCacheBundle::class => ['all' => true],
- Configure Environment Variables as needed:
REDIS_DSN(if using Redis, so basically always)MLC_DISABLE_READ(optional, disables cache reads if it exists at all, no matter the value)MLC_COLLECT_ENHANCED_DATA(optional, enables enhanced data collection but has performance impact)
Its a fast multi level cache consisting, in it's standard configuration, of:
- a fast In Memory Ring Cache
- and a second Level Redis Cache
- Faster and much more memory efficient than the symfony cache (We love it, but we needed something faster)
- Deduplication of cached objects on read
- Cache statistics and profiling (Symfony Profiler integration)
- Beta decay and TTL randomization to prevent stampedes
As mentioned above, the main way of using the MLC is via the Cached Service Generator.
Cached Service Generator Documentation
For details on how to use the MLC Service and Factory directly.
MultiLevelCacheService and MultiLevelCacheFactory Documentation
MIT
Awesome people who contributed to this package
thanks for support go to: