codeat3/laravel-responsecache-php72
A PHP 7.2-compatible fork of Laravel ResponseCache that speeds up your app by caching full responses. Store, tag, and invalidate cached pages easily, with support for middleware, cache profiles, and automatic clearing on model changes.
Architecture fit
CacheProfile class) but the correctness surface is large, because it sits in front of everything the app does per-request.laravel-responsecache. There is no architectural reason to choose it on a supported runtime — on PHP 7.4+/8.x, maintained upstream Spatie is strictly better on support, security response, and Laravel version tracking.Spatie\ResponseCache\... namespaces, so it is a drop-in replacement, not a co-installable peer. That is a dependency-planning fact a TPM must encode in the rollout: remove spatie/laravel-responsecache first; the two cannot coexist in composer.json.Integration feasibility
hasBeenCached() flips true on the second request. That low mechanical cost is why it is tempting to approve casually — don't.Vary logic, and a named engineer accountable for patches.Technical risk
forget(), clear(), model observers) but no policy; the policy is yours to design and test.Key questions
composer.json declare — verified from the fork, not inferred from upstream?ResponseCache::forget() on admin save events, TTL-only expiry, or tag-based clearing? Which is authoritative when they disagree?CacheProfile been specified to gate on Auth::guest(), reject query strings, and reject preview/admin cookies?Vary correctness?Stack fit
Migration path
Compatibility
Vary assumptions break silently there.useCacheNameSuffix() produces distinct keys where locale, tenant, or device class legitimately varies the response.Sequencing
hasBeenCached() and measure TTFB before/after.web group.Vary behavior, opt-out rules (doNotCacheResponse on auth, cart, checkout, preview), and the purge strategy per content type.CacheProfile before expanding scope.Maintenance
Support
ResponseCache::clear() (broad, expensive) and ResponseCache::forget($path) (surgical), and which is approved for routine content writes.Scaling
forget() on large URL spaces; broad clear() on a big site invites thundering herds and cache churn.Failure modes
Auth::guest() gating in the CacheProfile.Ramp-up
Vary, invalidation contracts, and session/auth interaction.CacheProfile as the primary guardrail — GET-only, Auth::guest(), reject query strings and preview/admin cookies — and on the TTL and cache-name-suffix logic. That class is where safety actually lives, and it should be reviewed like security code, because it is.How can I help you explore Laravel packages today?