PHPackages                             remic/guzzlecache - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. remic/guzzlecache

ActiveLibrary[HTTP &amp; Networking](/categories/http)

remic/guzzlecache
=================

Laravel 5 package for caching Guzzle's GET requests.

v0.2(10y ago)189.3k5[1 issues](https://github.com/RemiCollin/GuzzleCache/issues)MITPHPPHP &gt;=5.5

Since Mar 24Pushed 10y ago2 watchersCompare

[ Source](https://github.com/RemiCollin/GuzzleCache)[ Packagist](https://packagist.org/packages/remic/guzzlecache)[ RSS](/packages/remic-guzzlecache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

\#Guzzle Cache Laravel 5 Package

GuzzleCache is a simple wrapper around the [GuzzleHttp](http://docs.guzzlephp.org/en/latest/) library, aimed at optimizing API consuming applications by intercepting **GET** request and storing/retrieving responses from the Laravel's cache engine.

\##Installation

Grab the package with composer :

```

    composer require remic/guzzlecache:~0.2

```

\##Configuration

The GuzzleCache package works both with Laravel 5 and Lumen, but the configuration process is different.

\###Laravel

In Laravel, you need to register the packages service provider into your config/app.php configuration file :

```
    Remic\GuzzleCache\GuzzleCacheServiceProvider::class,
```

If you're using facades, add this line to the corresponding section in config/app.php :

```
    'GuzzleCache'   => Remic\GuzzleCache\Facades\GuzzleCache::class,
```

GuzzleCache come shipped with a default configuration file, if you wish to override these defaults, you have to publish the configuration file :

```

    artisan vendor:publish

```

\###Lumen

In Lumen, you need to register the package's service provider into the bootstrap/app.php file :

```
    $app->register(Remic\GuzzleCache\GuzzleCacheServiceProvider::class);
```

If you wish to use the GuzzleCache facade, first make sure `$app->withFacades();` is uncommented in `bootstrap/app.php`, then add the following class alias :

```
    class_alias(Remic\GuzzleCache\Facades\GuzzleCache::class, 'GuzzleCache');
```

In Lumen, the configuration is handled via the .env file at the root of the project. Here are the default values used by GuzzleCache. If you wish to modify these, just copy and paste these to your .env file :

```

GUZZLECACHE_LIFETIME=60
GUZZLECACHE_STORE=
GUZZLECACHE_PREFIX=guzzlecache_

```

\##Usage

From your L5 application, call:

```
$client = GuzzleCache::client(['base_url' => 'http://httpbin.org']);

$res = $client->get('/');

echo $res->getStatusCode();
```

Here, the $client object is an instance of Guzzle client. You can refer to [Guzzle Documentation](http://docs.guzzlephp.org/en/latest/) for more details.

\###Specifying a custom lifetime

You can specify an optionnal lifetime when requesting a Guzzle client, that will override the defaults set in GuzzleCache config, for all request made with the object :

```
// Store all the request made with $client for 15 minutes
$client = GuzzleCache::client(['base_url' => 'http://httpbin.org'], 15);
```

\##License

MIT

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

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

Every ~157 days

Total

3

Last Release

3758d ago

### Community

Maintainers

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

---

Top Contributors

[![RemiCollin](https://avatars.githubusercontent.com/u/9589616?v=4)](https://github.com/RemiCollin "RemiCollin (15 commits)")

---

Tags

httpapiproxyGuzzlelumencachelaravel5

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/remic-guzzlecache/health.svg)

```
[![Health](https://phpackages.com/badges/remic-guzzlecache/health.svg)](https://phpackages.com/packages/remic-guzzlecache)
```

###  Alternatives

[kevinrob/guzzle-cache-middleware

A HTTP/1.1 Cache for Guzzle 6. It's a simple Middleware to be added in the HandlerStack. (RFC 7234)

43417.4M104](/packages/kevinrob-guzzle-cache-middleware)[hamburgscleanest/guzzle-advanced-throttle

A Guzzle middleware that can throttle requests according to (multiple) defined rules. It is also possible to define a caching strategy, e.g. get response from cache when rate limit is exceeded or always get cached value to spare your rate limits.

13033.4k1](/packages/hamburgscleanest-guzzle-advanced-throttle)[hamburgscleanest/laravel-guzzle-throttle

A Laravel wrapper for https://github.com/hamburgscleanest/guzzle-advanced-throttle.

7914.3k](/packages/hamburgscleanest-laravel-guzzle-throttle)[e-moe/guzzle6-bundle

Integrates Guzzle 6 into your Symfony application

11259.2k](/packages/e-moe-guzzle6-bundle)[rtheunissen/guzzle-cache-handler

Guzzle 6/7 handler used to cache responses

12142.8k](/packages/rtheunissen-guzzle-cache-handler)[rap2hpoutre/jacky

Opinionated REST JSON HTTP API client for laravel

174.4k](/packages/rap2hpoutre-jacky)

PHPackages © 2026

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