承接 dv0vd/laravel-redis-stale-refs-cleaner 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dv0vd/laravel-redis-stale-refs-cleaner

最新稳定版本:1.0.0

Composer 安装命令:

composer require dv0vd/laravel-redis-stale-refs-cleaner

包简介

Laravel console command to purge stale Redis cache references

README 文档

README

A lightweight Laravel console command that helps you keep your Redis cache clean and efficient by purging stale (broken) cache references.

In Laravel 6–8, there was no built-in way to safely clean up Redis sets containing references to keys that no longer exist. Laravel 9 introduced a helper command (php artisan cache:prune-stale-tags), but older versions require a custom solution — this package fills that gap.

Why This Package Exists

When using Redis to store reference sets (e.g., standard_ref for temporary caches or forever_ref for permanent caches), over time some referenced keys may expire or be deleted. This can lead to stale references, which in turn can cause:

  • Wasted memory in Redis
  • Inaccurate cache statistics
  • Unexpected behavior when iterating over cache sets

Without a safe cleanup process, these stale references accumulate, slowly “clogging” your cache and potentially affecting application performance.

This command automates the cleanup, safely removing references to keys that no longer exist, keeping your Redis cache tidy and efficient.

Features

  • Safe purging of stale cache references from Redis sets
  • Works with both phpredis (ext-redis) and predis/predis clients
  • Fully compatible with Laravel 6+
  • Chunked processing for large sets to avoid memory issues
  • Logs progress and provides a summary of purged keys
  • Easy to run via Artisan console

Installation

composer require dv0vd/laravel-redis-stale-refs-cleaner

Usage

  1. Run the command:
php artisan redis:purge-stale-refs
  1. Sit back, relax, and enjoy your clean Redis!

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-27