Skip to content

CakeDC/cakephp-compress-cache

Repository files navigation

CakeDC Compress Cache Plugin for CakePHP

Versions and branches

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

Overview

The CakeDC Compress Cache Plugin adds the ability to compress the content of the cache.

Requirements

  • CakePHP 4.5
  • PHP 8.1+

Installation

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

Configuration

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.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages