Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ethanhann/laravel-redisstore
Adds functionality to the Cache's built-in RedisStore.
https://github.com/ethanhann/laravel-redisstore
cache laravel laravel-5-package redis redis-store
Last synced: about 2 months ago
JSON representation
Adds functionality to the Cache's built-in RedisStore.
- Host: GitHub
- URL: https://github.com/ethanhann/laravel-redisstore
- Owner: ethanhann
- License: mit
- Created: 2017-01-15T04:40:13.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-24T18:38:35.000Z (about 7 years ago)
- Last Synced: 2024-10-12T13:10:54.755Z (2 months ago)
- Topics: cache, laravel, laravel-5-package, redis, redis-store
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 12
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### 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...
```sh
composer require ehann/laravel-redis-store
```Add a [custom cache driver](https://laravel.com/docs/5.3/cache#adding-custom-cache-drivers), like this...
```php
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...
```php
'stores' => [
'redis' => [
'driver' => 'ehann-redis',
],
],
```