PHPackages                             media24si/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. media24si/response-cache

AbandonedArchivedLibrary[Caching](/categories/caching)

media24si/response-cache
========================

Laravel 5 Response Cache Middleware

v0.1(10y ago)2132[1 issues](https://github.com/Media24si/ResponseCache/issues)MITPHPPHP &gt;=5.5.0

Since Sep 10Pushed 5y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Response cache
==============

[](#response-cache)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/562bdd95242e9a522d8decfdee75250fb830d4fbec649fddbcc841bbff7ace5a/68747470733a2f2f7472617669732d63692e6f72672f4d65646961323473692f526573706f6e736543616368652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Media24si/ResponseCache)

Laravel 5 response cache.

Install
-------

[](#install)

Require this package with Composer (Packagist), using the following command:

```
$ composer require media24si/response-cache
```

Register the ResponseCacheServiceProvider to the providers array in `config/app.php`

```
Media24si\ResponseCache\ResponseCacheServiceProvider::class
```

Publish vendor files (config file):

```
$ php artisan vendor:publish
```

To access cache manager register facade in `config/app.php`

```
'ResponseCacheManager' => Media24si\ResponseCache\Facades\ResponseCacheManagerFacade::class
```

Usage
-----

[](#usage)

Register middleware as a global in `app/Http/Kernel.php`

```
\Media24si\ResponseCache\Http\Middleware\CacheMiddleware::class
```

To cache response, mark response as public and set max-age (TTL):

```
return response()->json(['name' => 'John'])
		->setPublic()
		->setMaxAge(600);
```

Tag usage
---------

[](#tag-usage)

Many times you want to assing tags to URI. With assigned tags it's simple to clear more cached URIs.

To assign tag to caching response, set `cache-tags` header. To assign more tags, seperate them with comma (,).

To cache response, mark response as public and set max-age (TTL):

```
return response()->json(['name' => 'John'])
		->setPublic()
		->setMaxAge(600)
		->header('cache-tags', 'foo,bar,john,doe');
```

To flush all keys for tag:

```
ResponseCacheManager::flushTag('foo')
```

Config
------

[](#config)

Check `responseCache.php` for all possible configurations.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

3903d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17848fce32bf9d0ecfb9427ab0e842794bdd8b2c26eec791e5dad8d33b8703b5?d=identicon)[BostjanOb](/maintainers/BostjanOb)

---

Top Contributors

[![BostjanOb](https://avatars.githubusercontent.com/u/650818?v=4)](https://github.com/BostjanOb "BostjanOb (14 commits)")

---

Tags

responselaravelcachelaravel 5

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/media24si-response-cache/health.svg)](https://phpackages.com/packages/media24si-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)[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)[swiggles/memcache

Memcache driver for Laravel 5

1449.9k1](/packages/swiggles-memcache)[flc/laravel-middleware-cache-response

Laravel中间件-Response缓存

608.2k](/packages/flc-laravel-middleware-cache-response)

PHPackages © 2026

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