Download the PHP package a9f/typo3-better-redirects without Composer
On this page you can find all versions of the php package a9f/typo3-better-redirects. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download a9f/typo3-better-redirects
More information about a9f/typo3-better-redirects
Files in a9f/typo3-better-redirects
Package typo3-better-redirects
Short Description Improved redirects handling for TYPO3, including optimized caching for large numbers of redirects
License
Informations about the package typo3-better-redirects
Better Redirects
A TYPO3 extension that replaces the built-in redirect matching with a multi-layer caching strategy optimized for large redirect sets (thousands of entries). Designed for TYPO3 13.4+ with the redirects system extension.
The Problem
TYPO3's default RedirectService queries and evaluates all redirects on every request. This works fine for small sets but becomes a bottleneck at scale.
How It Works
Redirect matching flows through three layers, each falling back to the next on a miss:
- Per-request result cache — database-backed cache keyed by
(host, path, query), TTL up to 24 hours. Avoids repeated matching for frequently-hit URLs. - PHP file cache — redirect data is compiled into PHP files in
var/cache/code/better_redirects/that are loaded and optimized by OPcache. Redirects are grouped by match type and organized into trie or hash structures for fast lookup. Files are sharded automatically when a type exceeds the threshold (default: 1,000 entries per type). - TYPO3's default
RedirectService— fallback if the PHP file cache is unavailable or cold.
Cache invalidation is automatic: when a redirect record is saved or deleted via the TYPO3 backend, the result cache entries and the PHP file cache for that host are flushed immediately.
Important Notes
The extension is active as soon as it is installed. No configuration is required.
TYPO3's built-in redirect cache (
RedirectCacheService) is superseded by the PHP file cache and effectively becomes irrelevant. The built-in cache is still rebuilt on redirect changes (because the extension subclassesRedirectCacheService), but redirect matching never reaches it under normal operation.The extension aliases
RedirectServiceandRedirectCacheServiceto its own subclasses via Symfony DI. Any code that injects these classes by their concrete TYPO3 type will transparently receive the caching variants.
Installation
Activate the extension in the TYPO3 Extension Manager or via:
No additional configuration is required. The PHP file cache is populated automatically on the first request after installation (or after a cache flush).
Configuration
One optional setting is available via $GLOBALS['TYPO3_CONF_VARS']:
| Key | Default | Description |
|---|---|---|
EXTENSIONS/better_redirects/splitThreshold |
1000 |
Number of redirects per match-type bucket above which the generated PHP file is split into shards |
Set it in config/system/additional.php (or equivalent):
Requirements
- TYPO3 13.4
typo3/cms-redirectssystem extension- PHP 8.2+
- OPcache recommended (the PHP file cache provides no benefit without it)
All versions of typo3-better-redirects with dependencies
typo3/cms-core Version ^13.4
typo3/cms-redirects Version ^13.4