vectorial1024/laravel-cache-evict
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:
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.
Cache store contracts or via raw driver access — and does it honor the configured key prefix and store name?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.
withoutOverlapping().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.
KEYS on a large Redis instance) → latency incident; disqualifying if present.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.
How can I help you explore Laravel packages today?