PHPackages                             weakbit/fallback-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. weakbit/fallback-cache

ActiveTypo3-cms-extension[Caching](/categories/caching)

weakbit/fallback-cache
======================

Keeps TYPO3 sites responsive by switching cache operations to configured fallback backends when primary cache backends fail.

2.0.1(1mo ago)011GPL-2.0-or-laterPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Sep 23Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/andersundsehr/fallback-cache)[ Packagist](https://packagist.org/packages/weakbit/fallback-cache)[ RSS](/packages/weakbit-fallback-cache/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (16)Versions (6)Used By (1)

What does it do?
================

[](#what-does-it-do)

In simple words - it makes your Website reachable still if your cache does not work. Think about a network issue on the provider side where your Redis Cluster should be reachable. Or someone updates your SQL Cluster, configured for the TYPO3 Instance and did not tell you! Also, the fallback cache ensures components to be still cached, to reduce system load.

In addition, the Cache itself has a new Interface it can implement and tell this Extension it went bad:

- The cache could control its velocity
- It could check if it gets out of space
- It could be gracefully down for maintenance
- The cache backend was shut down in panic as a new security issue found
- Someone pulled the plug to do some vacuuming in the server room

After the fallback period the cache on the primary system is outdated and has to be cleared!

Recommendation
==============

[](#recommendation)

It is recommended to set

```
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][CacheManager::class] = [ 'className' => \Weakbit\FallbackCache\Cache\CacheManager::class ];
```

in additional.php or the equivalent settings.php file.

This ensures the override is applied early and reliably, avoiding issues with loading order or race conditions that can occur if set in extension files like ext\_localconf.php.

Example
-------

[](#example)

This defines a pages cache with the fallback cache: pages\_fallback.

To catch exceptions a variable frontend is set that sents a event with status yellow on exception.

```
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages'] = [
    // This frontend surrounds the functions by a try, and sends an event on exception (Status yellow)
    'frontend' => \Weakbit\FallbackCache\Cache\Frontend\VariableFrontend::class,
    'backend' => RedisBackend::class,
    'options' => [
        'defaultLifetime' => 604800,
        'compression' => 0,
    ],
    // If the cache creation fails (Status red) this cache is used
    'fallback' => 'pages_fallback',
    // Optional: turn yellow status events into red when this rate is exceeded
    'yellow_to_red_rate' => '10/minute',
    // The concrete frontend the 'frontend' is based on
    'concrete_frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
    'groups' => [
        'pages',
    ]
];

// Configure the fallback cache to use the database for example
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages_fallback'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages'];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages_fallback']['backend'] = Typo3DatabaseBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages_fallback']['options'] = [
    'defaultLifetime' => 604800,
];
```

You can *chain* them and also define a fallback for the fallback cache.

You could end the chain with a cache with the NullBackend, if that also fails the hope for this TYPO3 request is lost. But using no cache may bring down your server, but that depends on the server and application.

Yellow Status Rate
------------------

[](#yellow-status-rate)

The custom `VariableFrontend` emits a `YELLOW` status when cache read/write operations fail at runtime. By default, `YELLOW` does not switch to the fallback cache because the primary cache may recover.

Set `yellow_to_red_rate` on a cache configuration to promote `YELLOW` events to `RED` when a rate is exceeded:

```
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages']['yellow_to_red_rate'] = '10/minute';
```

With this example, ten `YELLOW` events for `pages` are tolerated per minute. The next `YELLOW` event inside the same minute is stored as `RED`. Once the status is `RED`, the cache manager uses the configured `fallback` cache. A `GREEN` status resets the limiter.

Supported formats include:

- `10/m`
- `10r/m`
- `10/minute`
- `10 events in a minute`
- `100/hour`
- `100 per 1 hour`

Status Cache Backend
--------------------

[](#status-cache-backend)

Use a high-speed backend for `weakbit__fallback_cache`, for example Redis or another low-latency cache. This cache stores only small status and counter payloads, but it may see many read/write operations while cache backends are unstable.

Immutable Cache Configuration
-----------------------------

[](#immutable-cache-configuration)

This extension provides the ability to mark certain caches as "immutable", which means they will not be affected by cache flushing operations. This is particularly useful for caches that contain data that rarely changes and is expensive to regenerate.

⚠️ **WARNING**: Immutable caches must be manually managed by developers. The system will NOT automatically clear these caches during regular maintenance operations!

### How to Configure Immutable Caches

[](#how-to-configure-immutable-caches)

To mark a cache as immutable, add the `tags` configuration with the `immutable` property set to `true`:

```
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['my_immutable_cache'] = [
    'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
    'backend' => \TYPO3\CMS\Core\Cache\Backend\FileBackend::class,
    'options' => [
        'defaultLifetime' => 604800,
    ],
    'groups' => [
        'system',
    ],
    'tags' => [
        ['name' => 'cache', 'identifier' => 'my_immutable_cache', 'immutable' => true]
    ]
];
```

### Behavior of Immutable Caches

[](#behavior-of-immutable-caches)

When a cache is marked as immutable:

1. It will **not** be cleared when `flushCaches()` is called
2. It will **not** be cleared when `flushCachesByTag()` is called with any tags
3. It will **not** be cleared when `flushCachesInGroup()` is called, even if the cache belongs to that group

This feature ensures that important cache entries remain available even during maintenance operations or when other parts of the system trigger cache flushes.

How to Access the Cache Status
==============================

[](#how-to-access-the-cache-status)

1. Log in to your TYPO3 backend
2. Look at the top toolbar (the black bar at the top of the screen)
3. Find the system information icon (typically shows system details like TYPO3 version)
4. Click on this icon to see a dropdown menu
5. The cache status will be displayed

[![Cache Status in System Information Toolbar](Documentation/system-information.png)](Documentation/system-information.png)

Credits
=======

[](#credits)

Inspired by

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance90

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~93 days

Total

4

Last Release

50d ago

Major Versions

1.1.0 → 2.0.02026-06-29

PHP version history (3 changes)1.0.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

1.1.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0

2.0.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce27306c234536251754f00414959671d4a775e9cf57cce2f5ea1dca158183d6?d=identicon)[andersundsehr](/maintainers/andersundsehr)

---

Top Contributors

[![weakbit](https://avatars.githubusercontent.com/u/12049749?v=4)](https://github.com/weakbit "weakbit (17 commits)")[![Kanti](https://avatars.githubusercontent.com/u/471387?v=4)](https://github.com/Kanti "Kanti (1 commits)")

---

Tags

rediscachehigh availabilitytypo3resiliencetypo3-cms-extensionfallback-cache

### Embed Badge

![Health badge](/badges/weakbit-fallback-cache/health.svg)

```
[![Health](https://phpackages.com/badges/weakbit-fallback-cache/health.svg)](https://phpackages.com/packages/weakbit-fallback-cache)
```

###  Alternatives

[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M674](/packages/shopware-core)[typo3/cms-core

TYPO3 CMS Core

3313.6M5.6k](/packages/typo3-cms-core)[lochmueller/staticfilecache

Transparent static file cache solution using mod\_rewrite and mod\_expires. Increase performance for static pages by a factor of 230!!

1281.4M4](/packages/lochmueller-staticfilecache)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

40543.5k](/packages/wazum-sluggi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
