CakePHP | CakeDC Compress Cache Plugin | Tag | Notes |
---|---|---|---|
^5.0 | 2.0.0 | 2.0.0 | stable |
^4.5 | 1.0.0 | 1.0.0 | stable |
The CakeDC Compress Cache Plugin adds the ability to compress the content of the cache.
- CakePHP 4.5
- PHP 8.1+
You can install this plugin into your CakePHP application using composer.
The recommended way to install composer package is:
composer require cakedc/cakephp-compress-cache
Next, load the plugin by running the following command:
bin/cake plugin load CakeDC/CompressCache
To configure the cache to use the Compressed Cache Engine, create a configuration similar to the one below in your config/app.php
file. Include the configuration for your target cache engine in the wrapped key.
// ...
'Cache' => [
// ...
'your_cache_configuration' => [
'className' => \CakeDC\CompressCache\Cache\Engine\CompressEngine::class,
'wrapped' => [
'className' => \Cake\Cache\Engine\FileEngine::class,
'prefix' => 'myapp_your_cache_configuration_',
'path' => CACHE ,
'serialize' => true,
'duration' => '+1 years',
'url' => env('CACHE_YOUR_CACHE_CONFIGURATION_URL', null),
],
'duration' => '+24 hours',
],
// ...
],
// ...
The Compressed Cache Engine will compress data before storing it in the cache and decompress it when reading it from the cache.