Download the PHP package kevinrob/guzzle-cache-middleware without Composer

On this page you can find all versions of the php package kevinrob/guzzle-cache-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package guzzle-cache-middleware

guzzle-cache-middleware

Latest Stable Version Total Downloads License Tests Scrutinizer Code Quality Code Coverage

A HTTP Cache for Guzzle 6+. It's a simple Middleware to be added in the HandlerStack.

Goals

Built-in storage interfaces

Installation

composer require kevinrob/guzzle-cache-middleware

or add it the your composer.json and run composer update kevinrob/guzzle-cache-middleware.

Why?

Performance. It's very common to do some HTTP calls to an API for rendering a page and it takes times to do it.

How?

With a simple Middleware added at the top of the HandlerStack of Guzzle.

Examples

Doctrine/Cache

You can use a cache from Doctrine/Cache:

You can use ChainCache for using multiple CacheProvider instances. With that provider, you have to sort the different caches from the faster to the slower. Like that, you can have a very fast cache.

Laravel cache

You can use a cache with Laravel, e.g. Redis, Memcache etc.:

Flysystem

WordPress Object Cache

Public and shared

It's possible to add a public shared cache to the stack:

Greedy caching

In some cases servers might send insufficient or no caching headers at all. Using the greedy caching strategy allows defining an expiry TTL on your own while disregarding any possibly present caching headers:

Delegate caching

Because your client may call different apps, on different domains, you may need to define which strategy is suitable to your requests.

To solve this, all you have to do is to define a default cache strategy, and override it by implementing your own Request Matchers.

Here's an example:

With this example:

Drupal

See Guzzle Cache module.

Links that talk about the project

Development

Docker quick start

Initialization

Running test

Entering container shell


All versions of guzzle-cache-middleware with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
guzzlehttp/guzzle Version ^6.0 || ^7.0
guzzlehttp/promises Version ^1.4 || ^2.0
guzzlehttp/psr7 Version ^1.7.0 || ^2.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kevinrob/guzzle-cache-middleware contains the following files

Loading the files please wait ....