itzbund/gsb-clustered-caching

Distributed cache management for clustered TYPO3 environments. This is part of the Government Site Builder (GSB) 11. The GSB 11 is a measure of the Dienstekonsolidierung Bund (DKB) of the Federal Ministry of the Interior and for Homeland (BMI) and is carried out on behalf of the Information Technolo

Installs: 700

Dependents: 1

Suggesters: 1

Security: 0

Type:typo3-cms-extension

pkg:composer/itzbund/gsb-clustered-caching

v2.0.0-rc.4 2025-10-09 10:46 UTC

README

GSB 11 Extension gsb_clustered_caching

TYPO3 13

This extension adds three features

  • Clearing caches when asked for, by means of a middleware (/gsb-clustered-caching/)
  • Asking for caches clears when caches are cleared
  • A command to clear caches based on the current version

About

It is part of the Government Side Builder 11.

Learn more about the GSB 11.

Installation

The best way to install this extension is to start with the GSB Sitepackage Kickstarter extension.

Quick installation without GSB Sitepackage Kickstarter

In a composer-based TYPO3 installation you can install the extension EXT:gsb_clustered_caching via composer:

  composer config -g gitlab-domains git.gsb-itzbund.de && \
  composer config -g repositories.gsb-clustered-caching vcs https://gitlab.opencode.de/bmi/government-site-builder-11/extensions/gsb_clustered_caching
  composer require itzbund/gsb-clustered-caching

In TYPO3 installations above version 11.5 the extension will be automatically installed. You do not have to activate it manually.

Configuration

You have to configure $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['gsb_clustered_caching']['serviceBroadcaster'] to a proper value, e.g.

http://service-broadcaster:8080/broadcast/gsb11-frontend-headless/8080/gsb-clustered-caching/,http://service-broadcaster:8080/broadcast/gsb11-backend-headless/8080/gsb-clustered-caching/

This is a combination of this extension listening to the /gsb-clustered-caching/ endpoint and the service-broadcaster configuration.

Note: The service-broadcaster is a service that accepts a request and sends it to targeteted services. Idealy the target service and port can be passed in the url.

Feature Flags

This document explains how to use feature flags. We separate between two different kinds of feature flags:

Feature

Feature flags allow you to enable or disable specific features in your installation. \ This is of particular importance to disable features that have not passed the approval process.

Optional

Optional flags allow you to (de-)activate specific features for your installation. \ A practical use for these is the (de-)activation of an extension.

For more information about feature flags in TYPO3, please refer to the official TYPO3 Documentation on Feature Flags.

Feature Flag Configuration

Feature and Optional flags are configured in the .env or the local-dev/.ddev/docker-compose.environment.yaml file on ddev machine. To add a feature flag, use the following syntax:

# FEATURE FLAG
- TYPO3__SYS__features__GSB11_FEATURE_123_NEW_FEATURE=%const(bool:true)%
# OPTIONAL FLAG
- TYPO3__SYS__features__GSB11_OPTION_123_ENABLE_EXTENSION=%const(bool:true)%

In this example, both feature flags, GSB11_FEATURE_123_NEW_FEATURE and GSB11_OPTION_123_ENABLE_EXTENSION, are set to true. To disable the feature, change the value to false or delete the setting.

Feature Flag Truth Table

This table illustrates the behavior of feature flags in various states.

Feature Flag StateEvaluated ValueDescription
featureFlag = truetrueThe feature is explicitly enabled.
featureFlag = falsefalseThe feature is explicitly disabled.
featureFlag = ''falseAn empty value is treated as false.
featureFlag not existfalseA non-existent flag defaults to false.

Usage in PHP Code

To use a feature flag in your PHP code, you can check the flag's value with the isFeatureEnabled() method of the Features class:

if (GeneralUtility::makeInstance(Features::class)->isFeatureEnabled('GSB11_FEATURE_123_NEW_FEATURE')) {
    echo 'Feature is enabled';

    // Feature-specific code
    ...
}

Usage in Fluid Templates

Feature flags can also be checked in your Fluid templates with TYPO3's Feature ViewHelper.

Basic usage

<f:feature name="GSB11_FEATURE_123_NEW_FEATURE">
   This is being shown if the flag is enabled
</f:feature>

Feature > then > else

<f:feature name="GSB11_OPTION_123_ENABLE_EXTENSION">
    <f:then>
        Flag is enabled
    </f:then>
    <f:else>
        Flag is undefined or not enabled
    </f:else>
</f:feature>

Current feature flags of gsb_clustered_caching

Feature flagDescription
currently none-

Usage

This extension works without manual action. Further information in the Documentation.

Command

This extension provides a command that will trigger a cache flush if a system state change has been identified. A state change can be identified by

  • providing a version argument
  • the composer state
typo3 gsbclusteredcaching:flushCacheOnStateChange [version] [-g groups]

There is one argument (the version) and an optional option (--groups or -g) that defines which cache groups should be flushed.

Contribute

As with TYPO3, we encourage you to join the project by submitting changes. Development of the GSB 11 happens mainly in the GSB 11 TYPO3 extension repositories.

To get started, have a look at our detailed contribution walkthrough.