Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Cache Evict Laravel Package

vectorial1024/laravel-cache-evict

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package occupies a narrow, well-defined slot in a Laravel application: a scheduled housekeeping task that physically removes cache entries whose TTL has already elapsed. This matters because Laravel's cache abstraction treats expiry as logical — a key becomes unreadable on read, but the underlying storage (database rows, files on disk) is not necessarily reclaimed. For drivers that delegate eviction to the backend (Redis, Memcached), the package adds little; for drivers where expired entries persist as storage cost (database, file, and to a lesser degree DynamoDB), it addresses a real accumulation problem. Architecturally this is a strong fit because it is non-invasive: it should not sit on the application's read/write path, should not replace the cache store, and should be removable without touching application code. Any design that required wrapping or substituting the cache driver would be a red flag.

Integration feasibility. Presumed standard Laravel package ergonomics: Composer install, service-provider auto-discovery, optionally a publishable config file, and one or more artisan commands registered into the scheduler. The realistic integration effort is measured in hours, not sprints. Release 2.1.2's relaxation of the PHP floor is a compatibility signal rather than a capability: it lowers the barrier to installing on older runtimes, which matters if the estate has mixed PHP versions, and it lets us adopt now and defer a runtime bump. It does not tell us whether the package works on our Laravel version — that must be confirmed from composer.json's illuminate/* constraints, not from the release note.

Technical risk. Three categories:

  • Maintainer and supply-chain risk (high relative to feature value). 59 stars indicates very low adoption, and the release note is terse enough that documentation cannot be assumed. Expect de facto self-support. Mitigant: the feature is small enough to audit in an afternoon and cheap enough to replace with an in-house command, which caps the downside.
  • Blast-radius risk (moderate, and the one that actually matters). The package deletes data by design. The failure that hurts is not "some garbage left behind" — that is benign — it is an over-broad sweep that removes still-live entries, causing a cold cache and a thundering-herd spike against the origin database. Secondary risks: a long-running sweep overlapping with its next scheduled run, and lock/IO contention on the cache table during peak traffic.
  • Driver-behavior risk (unknown until verified). How the package enumerates keys is decisive. Redis KEYS is O(N) and blocks the server; SCAN is acceptable. Database eviction needs an index on the expiry column or it degrades to a full table scan. File eviction needs bounded directory traversal. Multi-tenant or shared cache prefixes raise the question of whether the sweep respects the configured prefix and cannot reach another tenant's keyspace.

Key questions for the maintainer / source review.

  1. Which cache drivers are supported, and for each, what is the enumeration strategy (SCAN vs KEYS, indexed query vs table scan, recursive directory walk)?
  2. Does it operate through Laravel's Cache store contracts or via raw driver access — and does it honor the configured key prefix and store name?
  3. Is there batching/rate limiting, a max-runtime or memory ceiling, and overlap protection for the scheduler?
  4. How does it behave if a key is re-written between enumeration and deletion? Is deletion conditional on expiry?
  5. Is there any locking, and what happens under concurrent sweeps across multiple app servers?
  6. What observability exists — counts deleted, duration, structured logs, non-zero exit codes on failure?
  7. Does it interact correctly with cache tags, if the underlying store supports them?
  8. Provenance check: the stated last release date (2026-09-10) should be verified against the repository's tag history before it is treated as evidence of active maintenance.

Integration Approach

Stack fit. Appropriate for a standard Laravel service running the scheduler (cron-driven schedule:run) or, less ideally, a queue worker. It assumes the application already uses Laravel's cache component and that the cache store is one of the accumulating types. The honest scoping statement: the value is driver-dependent. If the estate is Redis/Memcached throughout, this package is close to a no-op and should be deferred. Prioritize the service(s) using the database or file cache driver with high write volume and short TTLs — that is where reclaimable storage and table bloat actually exist.

Migration path. No data migration and no schema change are implied; the package operates on the existing store. Adoption is strictly additive: install, publish config if offered, register the command in the scheduler, observe. Rollback is deleting one schedule entry — a genuinely reversible decision, which is the single strongest argument for trialing it rather than debating it.

Compatibility. Two gates before merge: (a) the package's illuminate/* and PHP constraints against our supported-version matrix and CI images, re-running the suite on our oldest supported PHP to catch assumptions baked into the relaxed floor; (b) the full transitive graph — a relaxation upstream is worthless if a sibling dependency still pins a stricter PHP version. Also confirm the cache driver versions in production match what was tested (Redis server version, MySQL/Postgres, DynamoDB SDK).

Sequencing.

  1. Inventory cache stores per service (driver, TTL distribution, write rate, approximate key count) and pick the one or two where accumulation is measurable.
  2. Source audit against the key questions above; do not proceed on documentation alone.
  3. Staging benchmark on a production-like copy of the cache table or file tree: record duration, peak memory, query plan (confirm index usage), and lock wait.
  4. Pilot on one non-critical service, scheduled off-peak, with batching and withoutOverlapping().
  5. Instrument duration, volume deleted, and failures before broadening.
  6. Expand service by service, tuning cadence per store to write rate and TTL rather than copying one cron expression everywhere.

Operational Impact

Maintenance. Small feature surface, MIT license, low release churn — cheap to keep, but also thin maintainer redundancy. Standard posture: pin the version in the lockfile, treat upgrades as routine maintenance window items (2.1.2 is a patch and low-risk, but validate against CI first), and keep the in-house-replacement option costed as a contingency. Because the capability is small, the exit cost is low; that materially reduces the strategic risk of adopting a 59-star dependency.

Support. No formal support policy, deprecation schedule, or security-advisory process is evidenced; the release note defers detail to CHANGELOG.md and the description is a single sentence. Plan for self-support: the owning team must be able to read the source and reason about driver behavior. Budget a named owner — an unscheduled cron job nobody owns is how silent cache-corruption events happen.

Scaling. Cost scales with the number of expired entries and the driver's enumeration strategy, not with application traffic. Two scaling hazards: (a) an unindexed expiry-column delete on the database driver degrades as the table grows — the very condition the package exists to fix; (b) a long sweep that overlaps the next scheduled run, compounding load. Mitigate with batching, a max-runtime budget, and per-store cadence tuned to TTL and write volume.

Failure modes, ordered by business impact.

  • Over-deletion of live entries → cold cache → origin-database load spike. Highest severity; the reason to pilot and to require expiry-conditional deletes.
  • Overlapping executions → contention and duplicated work; fix with scheduler overlap locks.
  • Blocking enumeration (e.g. KEYS on a large Redis instance) → latency incident; disqualifying if present.
  • Partial sweep → expired data lingers; benign, self-corrects next run.
  • Permission or connection errors on the file/database store → command fails; need non-zero exit plus alerting, otherwise it fails silently forever.
  • Unbounded memory on large keyspaces → worker kill; verify batching.

Ramp-up. Low: a Laravel-competent engineer can install and schedule it in under a day. The real effort — and where a TPM should place the schedule and acceptance criteria — is the staging benchmark, the query-plan check, and the scheduler hygiene (overlap lock, timeout, alerting). Estimate a day of engineering plus a maintenance window; treat the "does it beat doing nothing" question as answered only after the staging numbers are in.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib