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.
Files in kevinrob/guzzle-cache-middleware
Short Description A HTTP/1.1 Cache for Guzzle 6. It's a simple Middleware to be added in the HandlerStack. (RFC 7234)
All versions of guzzle-cache-middleware with dependencies
Informations about the package guzzle-cache-middleware
A HTTP Cache for Guzzle 6+. It's a simple Middleware to be added in the HandlerStack.
- RFC 7234 compliance
- Performance and transparency
- Assured compatibility with PSR-7
Built-in storage interfaces
composer require kevinrob/guzzle-cache-middleware
or add it the your
composer.json and run
composer update kevinrob/guzzle-cache-middleware.
Performance. It's very common to do some HTTP calls to an API for rendering a page and it takes times to do it.
With a simple Middleware added at the top of the
HandlerStack of Guzzle.
You can use a cache from
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.
You can use a cache with Laravel, e.g. Redis, Memcache etc.:
WordPress Object Cache
Public and shared
It's possible to add a public shared cache to the stack:
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:
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:
- All requests to
example.orgwill be handled by
- All requests to
twitter.comwill be handled by
- All other requests won't be cached.
See Guzzle Cache module.