doxroot/laravel-redis-cache
Composer 安装命令:
composer require doxroot/laravel-redis-cache
包简介
A simple way to cache things in Laravel framework using "tags"
README 文档
README
composer require doxroot/laravel-redis-cache
Purpose
This library uses Laravel, but with a different approach to tags. It's mutch to say tags, as it uses the default Laravel cache system to create just a wrapper and nothing more around a powerful cache from the default Laravel core system.
What I don't like about tags in Laravel is the default mechanism. Each key stored in a tag has to be added to another list for later cleanup.
Well, in most applications, a simpler solution might be better.
This application will create a key like: tag:filter:key In Redis, we can simply remove all keys that start with some_path*. And that's it. Nothing more with this library.
I am making this available in the hope that it can help someone.
Some additional info
Just extend AbstractRedisCache for other needs. Very simple. Hard to say a library, because it's just an absolute minimal wrapper arounde Cache facade.
DoxrootDbQueryRedisCache::put(key1, value);
DoxrootDbQueryRedisCache::put(key2, value);
Add 2 keys
DoxrootDbQueryRedisCache::put(key3, value, filterKey: test);
DoxrootDbQueryRedisCache::put(key4, value, filterKey: test);
DoxrootDbQueryRedisCache::put(key5, value, filterKey: test1);
DoxrootDbQueryRedisCache::put(key6, value, filterKey: test1);
Add 4 more keys (total 6)
DoxrootDbQueryRedisCache::flush(); // will remove all 6 keys
DoxrootDbQueryRedisCache::flush(test); will remove only key3 && key4
DoxrootDbQueryRedisCache::flush(test1); will remove only key5 && key6
So, just a minimal wrapper for cache.
Some benchmark results:
Code used for Laravel:
Cache:tags([tag-name])->put(key, value);
Cache::tags([tag-name])->flush();
Code using this library:
DoxrootDbQueryRedisCache::put(key, value);
DoxrootDbQueryRedisCache::flush();
Results
Insert 100K rows using Laravel Time: 36.89 seconds
Insert 100K rows using this lib Time: 19.95 seconds
Insert 1M rows using Laravel Time: 373.27 seconds || 6.23 minutes
Insert 1M rows using this lib Time: 203.28 seconds || 3.38 minutes
Remove all data (1M rows) Laravel Time: 5.64 seconds
Remove all data (1M rows) using this lib Time: 1.63 seconds
doxroot/laravel-redis-cache 适用场景与选型建议
doxroot/laravel-redis-cache 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 doxroot/laravel-redis-cache 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 doxroot/laravel-redis-cache 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-07