Download the PHP package remic/guzzlecache without Composer
On this page you can find all versions of the php package remic/guzzlecache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package guzzlecache
Guzzle Cache Laravel 5 Package
GuzzleCache is a simple wrapper around the GuzzleHttp 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 :
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 :
If you're using facades, add this line to the corresponding section in config/app.php :
GuzzleCache come shipped with a default configuration file, if you wish to override these defaults, you have to publish the configuration file :
Lumen
In Lumen, you need to register the package's service provider into the bootstrap/app.php file :
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 :
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 :
Usage
From your L5 application, call:
Here, the $client object is an instance of Guzzle client. You can refer to Guzzle Documentation 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 :
License
MIT