Skip to main content
drupalreleases
Release: Cms 2.2.3 — Update released for Drupal core (2.2.3)! Release: Easy Breadcrumb 2.0.11 — Minor update available for module easy_breadcrumb (2.0.11). Release: Bootstrap 8.x-3.42 — Minor update available for theme bootstrap (8.x-3.42). Release: Editoria11y Accessibility Checker 3.0.10 — Minor update available for module editoria11y (3.0.10). Release: Editoria11y Accessibility Checker 2.2.24 — Minor update available for module editoria11y (2.2.24). Release: Leaflet 10.4.13 — Minor update available for module leaflet (10.4.13). Release: Flag 5.1.1 — Minor update available for module flag (5.1.1). Release: Layout Paragraphs 3.0.0-beta5 — New beta version released for module layout_paragraphs (3.0.0-beta5). Module Revived: Bootstrap 8.x-3.41 — Theme bootstrap updated after 6 months of inactivity (8.x-3.41). Security Coverage: Component Library — Module component_library now has official Drupal security advisory coverage.

Guzzle Cache

159 sites Security covered Drupal 10–11
View on drupal.org

This module provides a Drupal cache backend for Guzzle, a popular HTTP client library. It allows you to cache HTTP requests made by Guzzle directly within Drupal's caching system, improving performance by avoiding redundant requests.

Provides a Drupal cache backend for Kevinrob/guzzle-cache-middleware.

Usage

use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use Kevinrob\GuzzleCache\CacheMiddleware;
use Kevinrob\GuzzleCache\Strategy\PrivateCacheStrategy;
use Drupal\guzzle_cache\DrupalGuzzleCache;

// Create default HandlerStack
$stack = HandlerStack::create();

// Create a Drupal Guzzle cache. Its' useful to have a separate cache bin to
// manage independent of other cache bins. Here is how you might define such a
// cache bin in a *.service.yml file:
// cache.my_custom_http_cache_bin:
//   class: Drupal\Core\Cache\CacheBackendInterface
//   tags:
//     - { name: cache.bin }
//   factory: cache_factory:get
//   arguments: [my_custom_http_cache_bin]
$cache = new DrupalGuzzleCache(\Drupal::service('cache.my_custom_http_cache_bin'));

// Push the cache to the stack.
$stack->push(
  new CacheMiddleware(
    new PrivateCacheStrategy($cache)
  ),
  'cache'
);

// Initialize the client with the handler option
$client = new Client(['handler' => $stack]);

// Fetch the URI cached if available.
$response = $client->request('GET', 'http://www.example.com/');

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Apr 2023
Latest release
3 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
3.1.0 Stable 10–11 Jun 22, 2026
3.0.2 Stable Aug 4, 2023
3.0.1 Stable Apr 21, 2023