traackr / cache-engines
CakePHP Cache Engines
Installs: 52 846
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 18
Forks: 0
Open Issues: 1
Type:cakephp-plugin
Requires
- php: >=5.3
- composer/installers: *
- predis/predis: v0.8.5
Requires (Dev)
- cakephp/cakephp: 2.10.22
- m6web/redis-mock: v2.8.*
- phpunit/phpunit: 4.8.*
- dev-master
- 0.3.7
- 0.3.6
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1
- dev-EMP-1641-composer-updates
- dev-dependabot/composer/composer-e5830dd286
- dev-CAMP-976-missing-prefix-child-keys
- dev-CAMP-976-multi-parent-cache-key
- dev-Patch-writeWithParent-FallbackEngine
- dev-BI-8371-scan-count
- dev-code-polish
- dev-dvlp
- dev-cake3
This package is auto-updated.
Last update: 2025-03-05 16:15:57 UTC
README
This CakePHP plugin provides some additional cache engines that can be used by CakePHP.
We currently provide three cache engines:
- RedisTreeCacheEngine: Redis based cache that supports managing keys using wildcards and cache key 'parents'.
- FileTreeCacheEngine: Local filesystem based cache that supports managing keys using wildcards and cache key 'parents'.
- FallBackCacheEngine: Allows you to define two cache engines; the first engine is used as the primary cache engine. The second cache engine is used only if the primary fails.
##Installation
$ cd /path/to/cake/application/app
$ composer require traackr/cache-engines
$ composer update
##Configuring the Engines
To configure and use these cache engines, simply specify the cache engine name in the appropriate configuration file
(this is typically app/Config/bootstrap.php
, c.f., CakePHP cache configuration documentation). The
RedisTreeeEngine
and FileTreeEngine
take the same arguments as the RedisEngine
and FileEngine
that ship with
CakePHP:
Cache::config("post_data", array(
'engine' => 'RedisTree',
'server' => 'redis-server',
'port' => 6379,
'duration' => 300,
'prefix' => 'posts:'
));
FallbackEngine
expects a configuration for the primary and secondary engines:
Cache::config("post_data", array(
'engine' => 'Fallback',
'name' => "post_data",
'primary' => array(
'profile' => '2.8', // optional, if you want to hardcode a predis profile to use
'engine' => 'RedisTree',
'server' => 'redis-server',
'port' => 6379,
'duration' => 300,
'prefix' => 'posts:'
),
'secondary' => array(
// alternate cache if Redis fails
'engine' => 'FileTree',
'path' => CACHE.'/data/',
'duration' => 300
)
));
##Documentation
All other documentation can be found in the doc folder.
##Contributing