# spatie/laravel-responsecache

Speed up a Laravel app by caching the entire response

Repository: https://github.com/spatie/laravel-responsecache
Canonical: https://ross.abutalabs.com/products/laravel-responsecache
Homepage: https://spatie.be/docs/laravel-responsecache/v8/introduction
Language: PHP
License: MIT
License Family: permissive
Topics: laravel, php, cache, varnish, performance
Last push: 2026-08-20T12:05:04+00:00

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 84, longevity 100
- inputs: {"age_days": 4066, "days_push": 13, "days_rel": 26, "gap_med": 32.0, "n_releases_24m": 17}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2811, forks 247 (observed 2026-08-28T04:07:23.692042+00:00)

## What it is
A Laravel package by Spatie that caches entire HTTP responses via middleware, returning cached responses for repeat GET requests without re-running the application. It supports configurable lifetimes, per-user cache separation, flexible stale-while-revalidate caching, and programmatic or artisan cache clearing.

## Use cases
- speed up laravel app by caching full http responses
- cache html and json get requests in laravel
- serve stale pages while refreshing cache in background
- clear response cache via artisan command
- cache responses per logged-in user separately
- reduce server load for slow laravel pages

## When to choose
- you run a Laravel app with mostly cacheable GET pages
- you want app-level response caching without configuring Varnish or a CDN
- you need fine-grained control over which routes are cached via middleware
- you want stale-while-revalidate behavior for slightly stale pages

## When to avoid
- your app serves highly dynamic, personalized, or frequently changing content
- you already use a reverse proxy like Varnish or a CDN for full-page caching
- you need to cache non-GET requests or binary responses
- you are not using Laravel 12+ with PHP 8.4+

## Facets
- artifact type: plugin
- maturity: active
- function: caching, middleware, http-server
- domain: web-development, backend, performance, developer-tools
- platform: php, self-hosted
- tags: laravel-package, response-cache, http-cache, middleware, spatie, performance, laravel, web-server

## Member repositories
- spatie/laravel-responsecache (main) score 94

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:23.692042+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:49:03.041111+00:00, confidence not recorded.
  - readme: https://github.com/spatie/laravel-responsecache (fetched 2026-08-28T04:07:23.692042+00:00, sha ce9851214271)
  - homepage: https://spatie.be/docs/laravel-responsecache/v8/introduction (fetched 2026-08-29T09:54:11.034449+00:00, sha 027b2e52e5cf)
  - site_page: https://spatie.be/docs (fetched 2026-08-29T09:54:11.037097+00:00, sha 08e024d86d95)
  - site_page: https://spatie.be/about-us (fetched 2026-08-29T09:54:11.039184+00:00, sha d3cb88e4b34c)
  - site_page: https://spatie.be/docs/laravel-responsecache/v8 (fetched 2026-08-29T09:54:11.040868+00:00, sha 3fb7d7c44827)
  - site_page: https://spatie.be/docs/laravel-responsecache/v8/support-us (fetched 2026-08-29T09:54:11.042566+00:00, sha 2ad6650fa8f6)
  - site_page: https://spatie.be/docs/laravel-responsecache/v8/requirements (fetched 2026-08-29T09:54:11.044569+00:00, sha 308e9f32d0dd)
  - site_page: https://spatie.be/docs/laravel-responsecache/v8/installation-setup (fetched 2026-08-29T09:54:11.046565+00:00, sha 9069a40d6d08)
  - site_page: https://spatie.be/docs/laravel-responsecache/v8/questions-issues (fetched 2026-08-29T09:54:11.048193+00:00, sha b8af66fea27e)
  - site_page: https://spatie.be/docs/laravel-responsecache/v8/changelog (fetched 2026-08-29T09:54:11.049740+00:00, sha c4eb3d01aafe)
- Data as of 2026-08-30T08:39:29.467469+00:00.
