Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Responsecache Laravel Package

spatie/laravel-responsecache

Caches full Laravel responses to speed up apps. Automatically stores successful GET HTML/JSON for a configurable time and serves cached output on repeat requests. Supports per-route middleware, custom rules, and optional stale-while-revalidate style caching.

View on GitHub
Deep Wiki
Context7
8.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.2.0...8.3.0

8.1.0

What's Changed

  • Add Laravel 13 support
8.0.0

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 Event suffix (e.g. CacheMissedCacheMissedEvent)
  • Replace cacheRequestUntil() with cacheLifetimeInSeconds() in CacheProfile interface
  • Replace CacheResponse::using() with CacheResponse::for() and FlexibleCacheResponse::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.2

What's Changed

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.1...7.7.2

7.7.1

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.0...7.7.1

7.7.0

What's Changed

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.5...7.7.0

7.6.5
7.6.4

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.3...7.6.4

7.6.3

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.2...7.6.3

7.6.2

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.1...7.6.2

7.6.1
7.6.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.5.2...7.6.0

7.5.2
7.5.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.10...7.5.0

7.4.10

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.9...7.4.10

7.4.9
  • Fix docblock
7.4.8

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.7...7.4.8

7.4.7

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.6...7.4.7

7.4.6
  • add support for L10
7.4.5

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.4...7.4.5

7.4.4

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.3...7.4.4

7.4.3
7.4.2
7.4.1

What's Changed

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.0...7.4.1

7.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.2.0...7.3.0

7.2.0
  • support Laravel 9
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport