spatie/laravel-responsecache
Speed up a Laravel application by caching the entire response
8.4.3
9.5M downloads/mo
#1369 most downloaded on Packagist
spatie/laravel-responsecache
What this package is like to depend on
Last release 16 days ago
07 Aug 2026
Release timing varies
gaps range from 2 weeks to 6 months
Nearly every release is documented
notes for 87 of 89 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
89 releases · first in 2015
9 releases in the last 12 months
see the full history below
Release timeline
89 releases · Jul 2015 to Aug 2026Releases
latest 60 of 89-
8.4.307 Aug 2026Release notes
Open source →What's Changed
- Read cache attributes from invokable controllers registered without a method by @freekmurze in #527
Full Changelog: 8.4.2...8.4.3
Release notes
Open source →What's Changed
- Read cache attributes from invokable controllers registered without a method by @freekmurze in https://github.com/spatie/laravel-responsecache/pull/527
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.4.2...8.4.3
-
8.4.207 Aug 2026Release notes
Open source →What's Changed
- Bump actions/checkout from 6 to 7 by @dependabot[bot] in #522
- Remove obsolete Laravel 11 skips from event dispatch tests by @nikosv in #526
- Fix flexible cache expiring after grace instead of lifetime + grace by @nikosv in #525
New Contributors
Full Changelog: 8.4.1...8.4.2
Release notes
Open source →What's Changed
- Bump actions/checkout from 6 to 7 by @dependabot[bot] in https://github.com/spatie/laravel-responsecache/pull/522
- Remove obsolete Laravel 11 skips from event dispatch tests by @nikosv in https://github.com/spatie/laravel-responsecache/pull/526
- Fix flexible cache expiring after grace instead of lifetime + grace by @nikosv in https://github.com/spatie/laravel-responsecache/pull/525
New Contributors
- @nikosv made their first contribution in https://github.com/spatie/laravel-responsecache/pull/526
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.4.1...8.4.2
-
8.4.125 May 2026Release notes
Open source →What's Changed
- Fix forgetting multiple urls stopping at the first uncached url by @freekmurze in #521
Full Changelog: 8.4.0...8.4.1
Release notes
Open source →What's Changed
- 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
-
8.4.011 May 2026Release notes
Open source →What's Changed
- Bump dependabot/fetch-metadata from 3.0.0 to 3.1.0 by @dependabot[bot] in #519
- Treat null cache value as a miss to fix has/get race by @mattiasgeniar in #520
New Contributors
- @mattiasgeniar made their first contribution in #520
Full Changelog: 8.3.1...8.4.0
Release notes
Open source →What's Changed
- Bump dependabot/fetch-metadata from 3.0.0 to 3.1.0 by @dependabot[bot] in https://github.com/spatie/laravel-responsecache/pull/519
- Treat null cache value as a miss to fix has/get race by @mattiasgeniar in https://github.com/spatie/laravel-responsecache/pull/520
New Contributors
- @mattiasgeniar made their first contribution in https://github.com/spatie/laravel-responsecache/pull/520
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.3.1...8.4.0
-
8.3.115 Apr 2026Release notes
Open source →- Fix state sharing in
CacheResponsemiddleware betweenhandle()andterminate()when the middleware is not resolved as the same instance. State now travels on the request attributes. (#518)
Release notes
Open source →- Fix state sharing in
CacheResponsemiddleware betweenhandle()andterminate()when the middleware is not resolved as the same instance. State now travels on the request attributes. (#518)
- Fix state sharing in
-
8.3.003 Mar 2026Release notes
Open source →What's Changed
- Fix: defer cache storage to terminate() to include post-response modifications by @eguiluz in https://github.com/spatie/laravel-responsecache/pull/513
New Contributors
- @eguiluz made their first contribution in https://github.com/spatie/laravel-responsecache/pull/513
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.2.0...8.3.0
-
8.2.022 Feb 2026Release notes
Open source →What's Changed
- Add Laravel 13 and PHP 8.5 support by @freekmurze in #511
- Use spatie/php-attribute-reader by @freekmurze in #512
Full Changelog: 8.1.0...8.2.0
Release notes
Open source →What's Changed
- Add Laravel 13 and PHP 8.5 support by @freekmurze in https://github.com/spatie/laravel-responsecache/pull/511
- Use spatie/php-attribute-reader by @freekmurze in https://github.com/spatie/laravel-responsecache/pull/512
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.1.0...8.2.0
-
8.1.016 Feb 2026Release notes
Open source →What's Changed
- Switch SVG diagrams to light theme for readable text on docs
- Add responsecache development skill
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.0.0...8.1.0
-
8.0.016 Feb 2026Release notes
Open source →What's new
Flexible caching
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)));
PHP attributes for cache configuration
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() { ... }
Other changes
- Add support for PHP 8.4 and Laravel 12
- Drop support for PHP 8.3 and below, Laravel 11 and below
- Rename event classes to use
Eventsuffix (e.g.CacheMissed→CacheMissedEvent) - Replace
cacheRequestUntil()withcacheLifetimeInSeconds()inCacheProfileinterface - Replace
CacheResponse::using()withCacheResponse::for()andFlexibleCacheResponse::for() - Improved debug headers configuration
- Fix return types in Facade PHPDoc for
clear()andforget()
Full Changelog: 7.7.2...8.0.0
Release notes
Open source →What's Changed
- Add support for PHP 8.4 and Laravel 12
- Drop support for PHP 8.3 and below
- Drop support for Laravel 11 and below
- Add flexible caching via
FlexibleCacheResponsemiddleware — serves stale responses instantly while refreshing the cache in the background - Add PHP attributes (
#[Cache],#[FlexibleCache],#[NoCache]) for controller-level cache configuration - Rename event classes to use
Eventsuffix (e.g.CacheMissed→CacheMissedEvent) - Replace
cacheRequestUntil()withcacheLifetimeInSeconds()inCacheProfileinterface - Replace
CacheResponse::using()withCacheResponse::for()andFlexibleCacheResponse::for() - Improved debug headers configuration
- Fix return types in Facade PHPDoc for clear() and forget()
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.2...8.0.0
-
7.7.228 Aug 2025Release notes
Open source →What's Changed
- Fix Carbon3 diffInSeconds to use int and not float by @it-can in #500
- Bump actions/checkout from 4 to 5 by @dependabot[bot] in #498
- Bump stefanzweifel/git-auto-commit-action from 5.2.0 to 6.0.1 by @dependabot[bot] in #496
Full Changelog: 7.7.1...7.7.2
Release notes
Open source →What's Changed
- Fix Carbon3 diffInSeconds to use int and not float by @it-can in https://github.com/spatie/laravel-responsecache/pull/500
- Bump actions/checkout from 4 to 5 by @dependabot[bot] in https://github.com/spatie/laravel-responsecache/pull/498
- Bump stefanzweifel/git-auto-commit-action from 5.2.0 to 6.0.1 by @dependabot[bot] in https://github.com/spatie/laravel-responsecache/pull/496
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.1...7.7.2
-
7.7.117 Jul 2025Release notes
Open source →What's Changed
- Introduce using() method to conveniently define lifetime and tags by @kamilkozak in https://github.com/spatie/laravel-responsecache/pull/491
New Contributors
- @kamilkozak made their first contribution in https://github.com/spatie/laravel-responsecache/pull/491
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.0...7.7.1
-
7.7.020 May 2025Release notes
Open source →What's Changed
- 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
- Bump dependabot/fetch-metadata from 2.3.0 to 2.4.0 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/494
- [8.0] Introduce
ClearingResponseCacheFailedand return boolean byclear()by @alies-dev in https://github.com/spatie/laravel-responsecache/pull/495
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.5...7.7.0
-
7.6.510 Apr 2025Release notes
Open source →What's Changed
- fix DocBlock in ResponseCache Facade by @ricventu in https://github.com/spatie/laravel-responsecache/pull/492
New Contributors
- @ricventu made their first contribution in https://github.com/spatie/laravel-responsecache/pull/492
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.4...7.6.5
-
7.6.425 Feb 2025Release notes
Open source →What's Changed
- 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
- Bump dependabot/fetch-metadata from 2.2.0 to 2.3.0 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/488
- Add compatibility for Laravel 12. by @mazedlx in https://github.com/spatie/laravel-responsecache/pull/490
New Contributors
- @mazedlx made their first contribution in https://github.com/spatie/laravel-responsecache/pull/490
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.3...7.6.4
-
7.6.311 Dec 2024Release notes
Open source →What's Changed
- Fix ResponseCache Facade docblock for forget() by @alexcanana in https://github.com/spatie/laravel-responsecache/pull/486
New Contributors
- @alexcanana made their first contribution in https://github.com/spatie/laravel-responsecache/pull/486
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.2...7.6.3
-
7.6.209 Dec 2024Release notes
Open source →What's Changed
- CsrfTokenReplacer avoid str_replace(): by @thyseus in https://github.com/spatie/laravel-responsecache/pull/482
New Contributors
- @thyseus made their first contribution in https://github.com/spatie/laravel-responsecache/pull/482
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.1...7.6.2
-
7.6.118 Nov 2024Release notes
Open source →What's Changed
- Add PHPDoc for ResponseCache Facade by @alies-dev in https://github.com/spatie/laravel-responsecache/pull/485
New Contributors
- @alies-dev made their first contribution in https://github.com/spatie/laravel-responsecache/pull/485
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.0...7.6.1
-
7.6.005 Aug 2024Release notes
Open source →What's Changed
- 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
- Fix incorrect grammar by @SebKay in https://github.com/spatie/laravel-responsecache/pull/472
- Add missing Laravel 11.x Documentation by @omaratpxt in https://github.com/spatie/laravel-responsecache/pull/474
- Bump dependabot/fetch-metadata from 1.6.0 to 2.2.0 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/475
- Switch DefaultHasher to xxh128 for a faster alternative to MD5. by @marcell-ferenc in https://github.com/spatie/laravel-responsecache/pull/478
New Contributors
- @SebKay made their first contribution in https://github.com/spatie/laravel-responsecache/pull/472
- @omaratpxt made their first contribution in https://github.com/spatie/laravel-responsecache/pull/474
- @marcell-ferenc made their first contribution in https://github.com/spatie/laravel-responsecache/pull/478
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.5.2...7.6.0
-
7.5.203 Apr 2024Release notes
Open source →What's Changed
- Cast cache lifetime to integer by default by @dwightwatson in https://github.com/spatie/laravel-responsecache/pull/468
New Contributors
- @dwightwatson made their first contribution in https://github.com/spatie/laravel-responsecache/pull/468
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.5.1...7.5.2
-
7.5.123 Mar 2024Release notes
Open source →- allow Carbon 3
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.5.0...7.5.1
-
7.5.011 Mar 2024Release notes
Open source →What's Changed
- Add php 8.3 matrix by @binbyz in https://github.com/spatie/laravel-responsecache/pull/460
- Support Laravel 11
New Contributors
- @binbyz made their first contribution in https://github.com/spatie/laravel-responsecache/pull/460
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.10...7.5.0
-
7.4.1028 Oct 2023Release notes
Open source →What's Changed
- Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/449
- Bump stefanzweifel/git-auto-commit-action from 4.16.0 to 5.0.0 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/452
- Do not enable cache time header by default by @francoism90 in https://github.com/spatie/laravel-responsecache/pull/456
New Contributors
- @francoism90 made their first contribution in https://github.com/spatie/laravel-responsecache/pull/456
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.9...7.4.10
-
7.4.902 Oct 2023 -
7.4.827 Sep 2023Release notes
Open source →What's Changed
- Change PHPDoc for method clear(array ) in Facade by @kra-so in https://github.com/spatie/laravel-responsecache/pull/451
New Contributors
- @gomzyakov made their first contribution in https://github.com/spatie/laravel-responsecache/pull/437
- @kra-so made their first contribution in https://github.com/spatie/laravel-responsecache/pull/451
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.7...7.4.8
-
7.4.707 Apr 2023Release notes
Open source →What's Changed
- Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/427
- Property name changed by @Fot0n in https://github.com/spatie/laravel-responsecache/pull/428
- Typo fix in config responsecache by @dorqa95 in https://github.com/spatie/laravel-responsecache/pull/431
- Issue #342: CacheResponse race condition with has and get by @swichers in https://github.com/spatie/laravel-responsecache/pull/434
New Contributors
- @Fot0n made their first contribution in https://github.com/spatie/laravel-responsecache/pull/428
- @dorqa95 made their first contribution in https://github.com/spatie/laravel-responsecache/pull/431
- @swichers made their first contribution in https://github.com/spatie/laravel-responsecache/pull/434
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.6...7.4.7
-
7.4.623 Jan 2023 -
7.4.523 Jan 2023Release notes
Open source →What's Changed
- 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
- Normalize query string parameters before hashing by @cosmastech in https://github.com/spatie/laravel-responsecache/pull/426
New Contributors
- @cosmastech made their first contribution in https://github.com/spatie/laravel-responsecache/pull/426
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.4...7.4.5
-
7.4.425 Nov 2022Release notes
Open source →What's Changed
- Refactor tests to pest by @AyoobMH in https://github.com/spatie/laravel-responsecache/pull/418
- Add PHP 8.2 Support to tests workflow by @patinthehat in https://github.com/spatie/laravel-responsecache/pull/421
- Add Dependabot Automation by @patinthehat in https://github.com/spatie/laravel-responsecache/pull/420
- Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/423
- Bump stefanzweifel/git-auto-commit-action from 2.3.0 to 4.15.4 by @dependabot in https://github.com/spatie/laravel-responsecache/pull/422
- Catch CouldNotUnserialize exception and continue returning a response by @roberttolton in https://github.com/spatie/laravel-responsecache/pull/408
New Contributors
- @AyoobMH made their first contribution in https://github.com/spatie/laravel-responsecache/pull/418
- @dependabot made their first contribution in https://github.com/spatie/laravel-responsecache/pull/423
- @roberttolton made their first contribution in https://github.com/spatie/laravel-responsecache/pull/408
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.3...7.4.4
-
7.4.324 Sep 2022Release notes
Open source →What's Changed
- Dispatch clear events when using facade by @mateusjunges in https://github.com/spatie/laravel-responsecache/pull/413
New Contributors
- @mateusjunges made their first contribution in https://github.com/spatie/laravel-responsecache/pull/413
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.2...7.4.3
-
7.4.202 Sep 2022Release notes
Open source →What's Changed
- Always prepend app url to requests by @apeisa in https://github.com/spatie/laravel-responsecache/pull/409
New Contributors
- @apeisa made their first contribution in https://github.com/spatie/laravel-responsecache/pull/409
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.1...7.4.2
-
7.4.109 Aug 2022Release notes
Open source →What's Changed
- Cache bypass header now also prevents an already cached response from being returned by @fgilio in https://github.com/spatie/laravel-responsecache/pull/407
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.0...7.4.1
-
7.4.001 Aug 2022Release notes
Open source →What's Changed
- Add cache bypass header by @fgilio in https://github.com/spatie/laravel-responsecache/pull/406
New Contributors
- @fgilio made their first contribution in https://github.com/spatie/laravel-responsecache/pull/406
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.3.1...7.4.0
-
7.3.130 May 2022Release notes
Open source →What's Changed
- Handle missed cache gracefully by @antennaio in https://github.com/spatie/laravel-responsecache/pull/383
New Contributors
- @antennaio made their first contribution in https://github.com/spatie/laravel-responsecache/pull/383
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.3.0...7.3.1
-
7.3.016 May 2022Nothing published for this version
-
7.2.013 Jan 2022 -
7.1.027 Apr 2021 -
7.0.113 Apr 2021 -
7.0.002 Apr 2021 -
6.6.930 Mar 2021 -
6.6.825 Jan 2021 -
6.6.728 Nov 2020 -
6.6.522 Sep 2020 -
6.6.409 Sep 2020 -
6.6.322 Aug 2020 -
6.6.203 Jun 2020 -
6.6.122 Apr 2020 -
6.6.002 Mar 2020Release notes
Open source →- drop support for Laravel 6 to fix the test suite (namespace of
TestResponsehas changed)
- drop support for Laravel 6 to fix the test suite (namespace of
-
6.5.002 Mar 2020 -
6.4.001 Dec 2019 -
6.3.002 Sep 2019 -
6.2.106 Mar 2020 -
6.2.002 Sep 2019 -
6.1.107 Aug 2019 -
6.1.001 Aug 2019 -
6.0.231 Jul 2019 -
6.0.109 Jul 2019 -
6.0.020 May 2019Release notes
Open source →- added support for replacers
- you can now swap out
RequestHasherin favor of a custom one CacheAllSuccessfulGetRequestswill only cache responses of which the content type starts withtext- removed deprecated
Flushcommand \Spatie\ResponseCache\ResponseCacheFacadehas been removed- dropped support for carbon v1
- dropped support for PHP 7.2
-
5.0.310 May 2019 -
5.0.205 Apr 2019 -
5.0.115 Mar 2019