This yii-extension is a memcached drop in replacement for sessions and cache.
The file Session
handler and the file Cache
driver gets replaced in fortrabbit environments - it requires the Memcache component on the Professional Stack.
Read on why Memcache is mandatory in multi node environments
Require the package:
composer require fortrabbit/yii-memcached
Deploy the composer.json
and composer.lock
file.
That's it.
If your application does not run on fortrabbit, you need to provide the following ENV vars to make it work:
MEMCACHE_COUNT
(int, number of Memcached servers)MEMCACHE_HOST1
(host name of first Memcached server)MEMCACHE_PORT1
(port of first Memcached server)MEMCACHE_HOST(n)
(host name of nth Memcached server)MEMCACHE_PORT(n)
(port of nth Memcached server)