NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1361 most downloaded on Packagist
Speed up a Laravel application by caching the entire response
Latest stable
8.6.2
Last release 13 days ago
09 Nov 2026
Release timing varies
gaps range from 2 weeks to 6 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
95 releases · first in 2015
Drag across the ruler to compare, or tap a release to open it.
Cached pages no longer send a previous visitor's cookies to the next visitor. The visitor who first caches the page still receives their cookies. This
No config changes or cache clear are needed. The package API and cache format stay the same.
If you set cookies in a controller and need them on every request, move that code to middleware registered before the response cache middleware, or stop caching that route. Controllers don't run on cache hits. Laravel's usual session and CSRF cookies continue to work.
If you use cache.headers:etag, register it before the response cache middleware so Laravel can calculate an ETag for the updated page. If your application runs on several servers, update all of them; older servers keep the old behavior until they are updated.
See the upgrade guide and cookie examples.
Thanks to @sajjadhossainshohag for raising these issues in #537. The v9 serializer, performance, and locking changes are not part of this release.
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.6.1...8.6.2
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Store JSON cache entries without escaping slashes or Unicode, reducing unnecessary encoding while preserving the existing decoded cache format.
Existing JSON cache entries remain readable in both upgrade and downgrade directions; no cache flush is required. No public method signatures or supported PHP/Laravel versions changed. This release does not include the separate v9 changes proposed in #537.
Thanks to @sajjadhossainshohag for the original optimization in #536.
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.6.0...8.6.1
The default minimum remains one request, so existing behavior and published configuration files are unchanged. No breaking changes.
The default minimum remains one request, so existing behavior and published configuration files are unchanged. No breaking changes.
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.5.0...8.6.0
No public API breaking changes and no supported PHP or Laravel versions removed. Requests with excluded headers now intentionally bypass caching. Appl…
excluded_request_headers, defaulting to X-Livewire, X-Livewire-Navigate, and X-Inertia.No public API breaking changes and no supported PHP or Laravel versions removed. Requests with excluded headers now intentionally bypass caching. Applications opting back in should use a custom hasher when headers affect response content.
Thanks to @francoism90 for the original contribution in #530.
Full changelog: https://github.com/spatie/laravel-responsecache/compare/8.4.5...8.5.0
Bump to Double v1 by @jasonmccreary in https://github.com/spatie/laravel-responsecache/pull/533
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.4.4...8.4.5
Convert Mockery to Double by @jasonmccreary in https://github.com/spatie/laravel-responsecache/pull/528
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.4.3...8.4.4
Read cache attributes from invokable controllers registered without a method by @freekmurze in https://github.com/spatie/laravel-responsecache/pull/52
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.4.2...8.4.3
Bump actions/checkout from 6 to 7 by @dependabot[bot] in https://github.com/spatie/laravel-responsecache/pull/522
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.4.1...8.4.2
Fix forgetting multiple urls stopping at the first uncached url by @freekmurze in https://github.com/spatie/laravel-responsecache/pull/521
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.4.0...8.4.1
Bump dependabot/fetch-metadata from 3.0.0 to 3.1.0 by @dependabot[bot] in https://github.com/spatie/laravel-responsecache/pull/519
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.3.1...8.4.0
Fix state sharing in CacheResponse middleware between handle() and terminate() when the middleware is not resolved as the same instance. State now tra
CacheResponse middleware between handle() and terminate() when the middleware is not resolved as the same instance. State now travels on the request attributes. (#518)Fix: defer cache storage to terminate() to include post-response modifications by @eguiluz in https://github.com/spatie/laravel-responsecache/pull/513
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.2.0...8.3.0
Add Laravel 13 and PHP 8.5 support by @freekmurze in https://github.com/spatie/laravel-responsecache/pull/511
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.1.0...8.2.0
## What's Changed - Add Laravel 13 support
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.0.0...8.1.0
For pages where brief staleness is acceptable, you can now use flexible caching. After the lifetime expires, the stale response is still served instan
For pages where brief staleness is acceptable, you can now use flexible caching. After the lifetime expires, the stale response is still served instantly while the cache refreshes in the background. Once the grace period is over, the cache is considered expired and the next request will be fully recalculated:
use Spatie\ResponseCache\Middlewares\FlexibleCacheResponse;
Route::get('/dashboard', [DashboardController::class, 'index'])
->middleware(FlexibleCacheResponse::for(lifetime: hours(1), grace: minutes(5)));
You can now use attributes on controllers instead of middleware parameters:
use Spatie\ResponseCache\Attributes\Cache;
use Spatie\ResponseCache\Attributes\FlexibleCache;
use Spatie\ResponseCache\Attributes\NoCache;
#[Cache(lifetime: 3600, tags: ['dashboard'])]
public function index() { ... }
#[FlexibleCache(lifetime: 3600, grace: 300)]
public function show() { ... }
#[NoCache]
public function admin() { ... }
Event suffix (e.g. CacheMissed → CacheMissedEvent)cacheRequestUntil() with cacheLifetimeInSeconds() in CacheProfile interfaceCacheResponse::using() with CacheResponse::for() and FlexibleCacheResponse::for()clear() and forget()Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.2...8.0.0
FlexibleCacheResponse middleware — serves stale responses instantly while refreshing the cache in the background#[Cache], #[FlexibleCache], #[NoCache]) for controller-level cache configurationEvent suffix (e.g. CacheMissed → CacheMissedEvent)cacheRequestUntil() with cacheLifetimeInSeconds() in CacheProfile interfaceCacheResponse::using() with CacheResponse::for() and FlexibleCacheResponse::for()Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.2...8.0.0
Fix Carbon3 diffInSeconds to use int and not float by @it-can in https://github.com/spatie/laravel-responsecache/pull/500
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.1...7.7.2
Introduce using() method to conveniently define lifetime and tags by @kamilkozak in https://github.com/spatie/laravel-responsecache/pull/491
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.0...7.7.1
Bump stefanzweifel/git-auto-commit-action from 5.1.0 to 5.2.0 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/493
ClearingResponseCacheFailed and return boolean by clear() by @alies-dev in https://github.com/spatie/laravel-responsecache/pull/495Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.5...7.7.0
fix DocBlock in ResponseCache Facade by @ricventu in https://github.com/spatie/laravel-responsecache/pull/492
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.4...7.6.5
Bump stefanzweifel/git-auto-commit-action from 5.0.1 to 5.1.0 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/487
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.3...7.6.4
Fix ResponseCache Facade docblock for forget() by @alexcanana in https://github.com/spatie/laravel-responsecache/pull/486
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.2...7.6.3
CsrfTokenReplacer avoid str_replace(): by @thyseus in https://github.com/spatie/laravel-responsecache/pull/482
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.1...7.6.2
Add PHPDoc for ResponseCache Facade by @alies-dev in https://github.com/spatie/laravel-responsecache/pull/485
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.0...7.6.1
Bump stefanzweifel/git-auto-commit-action from 5.0.0 to 5.0.1 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/470
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.5.2...7.6.0
Cast cache lifetime to integer by default by @dwightwatson in https://github.com/spatie/laravel-responsecache/pull/468
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.5.1...7.5.2
- allow Carbon 3 Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.5.0...7.5.1
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.5.0...7.5.1
Add php 8.3 matrix by @binbyz in https://github.com/spatie/laravel-responsecache/pull/460
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.10...7.5.0
Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/449
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.9...7.4.10
- Fix docblock
Change PHPDoc for method clear(array ) in Facade by @kra-so in https://github.com/spatie/laravel-responsecache/pull/451
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.7...7.4.8
Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/427
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.6...7.4.7
- add support for L10
Bump stefanzweifel/git-auto-commit-action from 4.15.4 to 4.16.0 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/424
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.4...7.4.5
Refactor tests to pest by @AyoobMH in https://github.com/spatie/laravel-responsecache/pull/418
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.3...7.4.4
Dispatch clear events when using facade by @mateusjunges in https://github.com/spatie/laravel-responsecache/pull/413
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.2...7.4.3
Always prepend app url to requests by @apeisa in https://github.com/spatie/laravel-responsecache/pull/409
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.1...7.4.2
Cache bypass header now also prevents an already cached response from being returned by @fgilio in https://github.com/spatie/laravel-responsecache/pul
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.0...7.4.1
Add cache bypass header by @fgilio in https://github.com/spatie/laravel-responsecache/pull/406
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.3.1...7.4.0
Handle missed cache gracefully by @antennaio in https://github.com/spatie/laravel-responsecache/pull/383
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.3.0...7.3.1
Add option to output cache age header by @it-can in https://github.com/spatie/laravel-responsecache/pull/385
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.2.0...7.3.0
- support Laravel 9
- add CacheItemSelector
CacheItemSelector- add url option to ClearCommand
url option to ClearCommand (#348)use PHP 8 syntax where possible
- fix for issue #331
- use package service provider
- add support for PHP 8
- fix tagged responsecache:clear
- Support Laravel 8
replace Laravel/framework with individual packages
support JSON types other than application/json
change to the proper way of setting app URL on runtime
drop support for Laravel 6 to fix the test suite (namespace of TestResponse has changed)
TestResponse has changed)- add support for Laravel 7
drop support for all non-current PHP and Laravel versions
add support for custom serializers
make compatible with Laravel 7, so the package can be used on PHP 7.3
- make compatible with Laravel 6
restore laravel 5.7 compatibility
- add support for cache tags
One column per quarter.