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

Cache full Laravel responses to speed up your app. Automatically caches successful text-based GET requests (HTML/JSON), with easy middleware per route, configurable lifetimes, and optional stale-while-revalidate “grace” caching to refresh in the background.

View on GitHub
Deep Wiki
Context7
8.4.1

What's Changed

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.4.0...8.4.1

8.4.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.3.1...8.4.0

8.3.1
  • Fix state sharing in CacheResponse middleware between handle() and terminate() when the middleware is not resolved as the same instance. State now travels on the request attributes. (#518)
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai