Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Summary: this module allows website builders to change the block cache metadata through the administrative block interface (see attached images). Learn more about cache metadata here.

- - - - - -

In Drupal 8, blocks, as well as pages, are built from the idea of ​​rendering arrays. Rendering arrays determine what is shown to the user. Therefore, arrays also determine how cacheable an answer is. This is done using the #cache key, for example:

$build = [
  ...
  '#cache' => [
    'max-age' => 600,
    'tags' => ['user: administer'],
    'contexts' => ['user'],
  ],
  ...
];



Cacheability metadata consists of 3 properties: 

max-age — for time-sensitive caching, i.e. time dependencies;
contexts — for variations, i.e. dependencies on the request context;
tags — for dependencies on data managed by Drupal, like entities & configuration.

Core modules and community modules determine the values ​​for this metadata. In addition, Drupal currently does not provide the possibility to change block cache metadata from the graphical interface, only by implementing specific hooks.

If you do not like the default set, you can install this module and easily change the settings through the graphical interface. After installing this module, the configuration form for each block will display a set of fields called Cache Settings, where you can configure the cache metadata as you see fit.

Installation

Install as you would normally install a contributed Drupal module, for example:

$ composer require 'drupal/blocache:^2.0'

View Installing Modules for further information.

Maintainers

Developed and maintained by:

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
Jan 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
2.0.0 Stable Feb 22, 2023
2.0.0-rc1 Pre-release Jan 30, 2023
2.0.x-dev Dev Jan 20, 2023