ehann/laravel-redis-store

Adds functionality to the built-in Cache's RedisStore.
13,511 12
Install
composer require ehann/laravel-redis-store
Latest Version:0.2.1
License:MIT
Last Updated:Nov 24, 2017
Links: GitHub  ·  Packagist
Maintainer: ethanhann

Why is this useful?

The RedisStore that comes with the Laravel Cache does not compress string values out of the box. The RedisStore in this package does. Caching string values can save a ton of memory and/or network bandwidth depending on cached item size and request frequency.

How do I use it?

Install the package...

composer require ehann/laravel-redis-store

Add a custom cache driver, like this...

public function boot()
{
    Cache::extend('ehann-redis', function ($app) {
        return Cache::repository(new \Ehann\Cache\RedisStore(
            $app['redis'],
            $app['config']['cache.prefix'],
            $app['config']['cache.stores.redis.connection']
        ));
    });
}

Add the ehann-redis custom driver to the redis store config in config/cache.php...

'stores' => [
    'redis' => [
        'driver' => 'ehann-redis',
    ],
],

Related Packages

erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

628,058,007 9,707
laravel/framework

The Laravel Framework.

576,155,700 34,907
laravel/tinker

Powerful REPL for the Laravel framework.

485,678,092 7,440