PHPackages                             wowe/laravel-response-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. wowe/laravel-response-cache

AbandonedArchivedLibrary[Caching](/categories/caching)

wowe/laravel-response-cache
===========================

Route response caching for Laravel

v1.0.0(11y ago)61611MITPHPPHP &gt;=5.4.0

Since Oct 7Pushed 11y ago1 watchersCompare

[ Source](https://github.com/willrowe/laravel-response-cache)[ Packagist](https://packagist.org/packages/wowe/laravel-response-cache)[ Docs](https://github.com/willrowe/laravel-response-cache)[ RSS](/packages/wowe-laravel-response-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Response Cache for Laravel
==========================

[](#response-cache-for-laravel)

[![Build Status](https://camo.githubusercontent.com/3154795b7a300d939d568c65b5ebe19c9dc888974965d2a74e1610465286af2d/68747470733a2f2f7472617669732d63692e6f72672f77696c6c726f77652f6c61726176656c2d726573706f6e73652d63616368652e737667)](https://travis-ci.org/willrowe/laravel-response-cache)
**Response Cache for Laravel** provides an easy way for route responses to be cached, handling the storage and retrieval of the response as well as the necessary headers to utilize client-side browser caching.

[Installation](#installation)
[Configuration](#configuration)
[Usage](#usage)
[Release Notes](#release-notes)
[Version Compatibility](#version-compatibility)
[License](#license)

Installation
------------

[](#installation)

1. Add the package to your project's `composer.json` file.
    - Command Line:
        `composer require wowe/laravel-response-cache:1.0.*`
    - Edit Manually:

        ```
        "require": {
            "wowe/laravel-response-cache": "1.0.*"
        }

        ```
2. Update Composer.
    `composer update`
3. Add the service provider to your `app.php` config file.
    `'Wowe\Cache\Response\ServiceProvider'`

Configuration
-------------

[](#configuration)

The configuration file may be published to the `config` directory by using the command:

`php artisan config:publish wowe/laravel-response-cache`

*This is recommended since the configuration file that comes with the installation can be overridden by an update.*

**Available Settings**

- `enabled` (boolean)
    - Determines whether this package is turned on. If set to false, no responses will be cached, no matter the other settings. If set to true, caching will function normally. This is useful if you want to turn caching off in specific environments.
    - Default: true
- `life` (integer)
    - The number of minutes to cache the route responses. Only applies to routes which do not have cache life set in their action.
    - Default: 10080 minutes (1 week)
- `global` (boolean)
    - Whether to cache all get request responses. A value of true will cache all responses by default (inclusive mode). A value of false will cache no responses by default (exclusive mode).
    - Default: false

Usage
-----

[](#usage)

\###Simple Setup### For a simple site you may cache all responses generated by routes using the `GET` method by setting the `global` config setting to `true`. To adjust how long these responses will be cached just change the value of the `life` config setting.

\###Advanced Setup### For projects where you need more control over which route responses are cached you may use the available route actions:

- `cache`
    - No value: if `'cache'` is set on the action as a string then it is equivalent to `'cache' => true` and will cache the route's response.
    - True: if `'cache' => true` is set on the action then the route's response will be cached.
    - False: if `'cache' => false` is set on the action then the route's response *will not* be cached.
    - Integer: if an integer is set on the action (`'cache' => 90`), then the route's response will be cached for that many minutes.
- `no-cache`
    - This is simply a semantic shortcut for `'cache' => false` and should be set as a string on the action. *It cannot accept any value and should not appear in the action as a key.**These actions may be applied to either an individual route or a route group.*
- ***WARNING: DO NOT use more than one cache action on any single route as it will lead to unexpected behavior.***
- ***CURRENT LIMITATION: DO NOT set any cache actions on a route or route group that is nested inside another route group which already has a cache action set. At this time it will not override any parent groups and will break caching.***

\###Examples:###

- Enable Caching

```
// No value
Route::get('foo', ['FooController@getFoo', 'cache']);

// True
Route::get('bar', ['FooController@getBar', 'cache' => true]);

// Integer, will cache for 90 minutes
Route::get('baz', ['FooController@getBaz', 'cache' => 90]);

// Group
Route::group(['cache'], function () {
    Route::get('qux', 'FooController@getQux');
});
```

- Disable Caching

```
// No value
Route::get('foo', ['FooController@getFoo', 'no-cache']);

// False
Route::get('bar', ['FooController@getBar', 'cache' => false]);

// Group
Route::group(['no-cache'], function () {
    Route::get('qux', 'FooController@getQux');
});
```

Release Notes
-------------

[](#release-notes)

*Additional information can be found in the CHANGELOG.md file*

- v1.0.0 - Initial release

Version Compatibility
---------------------

[](#version-compatibility)

LaravelResponse Cache4.2.x1.0.xLicense
-------

[](#license)

The **Route Response for Laravel** package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4236d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd85655aa98bb76fc8280197bbdfdc7d28a8a9dfe972d6f0cee899b1290e41a2?d=identicon)[willrowe](/maintainers/willrowe)

---

Top Contributors

[![willrowe](https://avatars.githubusercontent.com/u/7152423?v=4)](https://github.com/willrowe "willrowe (28 commits)")

---

Tags

responselaravelcachecachingroute

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wowe-laravel-response-cache/health.svg)

```
[![Health](https://phpackages.com/badges/wowe-laravel-response-cache/health.svg)](https://phpackages.com/packages/wowe-laravel-response-cache)
```

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[maartenstaa/laravel-41-route-caching

This package allows you to cache your routes definitions, thereby speeding up each request.

25371.9k](/packages/maartenstaa-laravel-41-route-caching)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[dragon-code/laravel-cache

An improved interface for working with cache

6844.8k10](/packages/dragon-code-laravel-cache)[nexxai/laravel-cfcache

A handful of Cloudflare cache helpers for Laravel

1317.7k](/packages/nexxai-laravel-cfcache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
