salehhashemi/laravel-configurable-cache
A Laravel package for configurable caching that lets you define cache settings like TTL, keys, and stores per model or query instead of hardcoding them, keeping cache logic centralized and easy to adjust across your application.
CACHE_TTL and a single Redis store for the whole app, this package's premise is that cache behavior (TTL, store, key naming, invalidation strategy) is declared per model/entity/feature. That directly supports decisions like "product catalog caches for 15 minutes, user session-derived data for 60 seconds, pricing for 5 minutes with tag-based busting" without hardcoding values across the codebase.CacheService wrapper with per-model constants. This is a candidate to replace ~1–3 days of internal plumbing plus ongoing maintenance. Evaluate against that internal baseline, not against Laravel's built-in Cache facade, which is the real incumbent.Consider it when:
Look elsewhere / do not adopt when:
NOASSERTION license is a hard blocker for most legal/procurement reviews. Do not ship it in a commercial or redistributed product until the license is clarified in writing.Cache::tags() semantics — verify by reading the source; do not assume. Laravel's built-in tag support (Redis/Memcached) may already cover you.Minimum due-diligence gate before adoption: license clarification, a read of the full source (~small surface), confirmation of Laravel/PHP version support against your matrix, a test-suite check, and an internal fork if you proceed.
For executives (one paragraph): We are evaluating a small open-source Laravel component that would let us define caching rules per feature in configuration rather than in code. The business value is faster pages and lower database cost, delivered incrementally — we can cache one high-traffic area at a time and tune freshness per feature instead of applying a single blunt setting. The strategic caveat is maturity: it is a young, single-maintainer project with no adoption footprint and an unclear license. My recommendation is to treat it as a design reference, not a dependency — adopt the pattern internally with roughly one to three days of engineering, which removes the licensing and continuity risk entirely while capturing most of the benefit. If we later standardize across multiple services, we can revisit consuming it directly once the license is settled.
For engineering: The proposal is a thin, config-driven cache policy layer replacing scattered Cache::remember calls and magic-number TTLs. Benefits: cache definitions become reviewable config, per-environment strategy differences stop leaking into code, and invalidation logic has one home. Costs: a new dependency with a single maintainer, no dependents, NOASSERTION license, and unverified tag/stampede semantics. My ask is a time-boxed spike (half a day): read the source, map its invalidation model against our two riskiest cached entities, and compare the effort to a ~150-line internal implementation using Laravel's native cache contracts. Default to the internal implementation unless the spike shows meaningfully non-trivial logic we would otherwise get wrong — particularly around key derivation and invalidation. Either way, we should define cache policy in config files and document freshness expectations per entity, since that is the durable win regardless of which path we take.
How can I help you explore Laravel packages today?