dimafe6/redis-compressed-cache

Laravel 带有压缩功能的缓存驱动程序。

v1.0.1 2024-03-04 01:07 UTC

This package is auto-updated.

Last update: 2024-09-04 02:24:49 UTC


README

此驱动程序提供压缩和解压缩 Redis 数据的能力。

安装

您可以通过 composer 安装此包

composer require dimafe6/redis-compressed-cache

您可以使用以下命令发布配置文件

php artisan vendor:publish --tag="redis-compressed-cache-config"

这是发布配置文件的内容

return [
    'prefix'          => config('cache.prefix'),
    'connection'      => env('REDIS_COMPRESSED_CACHE_CONNECTION', 'cache'),
    'lock_connection' => env('REDIS_COMPRESSED_CACHE_LOCK_CONNECTION', 'default'),
    'enabled'         => env('REDIS_COMPRESSED_CACHE_ENABLED', true),
];

用法

将自定义驱动程序 redis-compressed 添加到 config/cache.phpredis 存储配置

'redis' => [
    'driver'          => 'redis-compressed',
    'connection'      => 'cache',
    'lock_connection' => 'default',
]

或者创建一个新的存储

'redis-compressed' => [
    'driver'          => 'redis-compressed',
]

鸣谢

许可证

MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件