PHP code example of remic / guzzlecache

1. Go to this page and download the library: Download remic/guzzlecache library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

remic / guzzlecache example snippets



    Remic\GuzzleCache\GuzzleCacheServiceProvider::class, 



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



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



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



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

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

echo $res->getStatusCode();



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