[BUGFIX] Use clustered cache entries per domain for redirects
'ext:redirect' now clusters the redirect cache into dedicated parts per domain, which reduces the data amount needed to load on redirect handling in the frontend to the absolute minimum. On the other hand, when rebuilding a cache this is narrowed down to the related domain, thus avoiding retrieving and caching all redirects, which may reduce the processing time in the backend on changing redirects or auto redirects creation on page updates. This works around some flaws for some instances and use cases, but do not harm on smaller instances with lower redirects count. * read and write redirect cache by domain based identifier * removed one array level from cached information and reduced one array key level in redirect matching code * cache identifier for domain entries are build using 'sha1()' * combined with early redirects introduced with #96480 this reduces the loaded data even more, as it is done in chunks * adjusted unit tests to reflect two redirect cache service calls, one for the domain and one for wildcard "*". * rebuilding cache through datahandler hook now rebuilds only for the related 'source_host', thus avoiding rebuild of all redirects for every change. This may still be further improved for multi record operations with the same domain. A 'rebuildAll()' fallback stayed as a last defense to cover cases where specific source_host cannot be determined. Resolves: #96617 Releases: main, 11.5 Change-Id: Id335017cf890dca7c57e892a2561c3555348a668 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73541 Tested-by:core-ci <typo3@b13.com> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/redirects/Classes/Hooks/DataHandlerCacheFlushingHook.php 55 additions, 5 deletions.../redirects/Classes/Hooks/DataHandlerCacheFlushingHook.php
- typo3/sysext/redirects/Classes/Service/RedirectCacheService.php 49 additions, 13 deletions...sysext/redirects/Classes/Service/RedirectCacheService.php
- typo3/sysext/redirects/Classes/Service/RedirectService.php 16 additions, 16 deletionstypo3/sysext/redirects/Classes/Service/RedirectService.php
- typo3/sysext/redirects/Classes/Service/SlugService.php 21 additions, 5 deletionstypo3/sysext/redirects/Classes/Service/SlugService.php
- typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php 3 additions, 1 deletion...xt/redirects/Tests/Functional/Service/SlugServiceTest.php
- typo3/sysext/redirects/Tests/Unit/Service/RedirectServiceTest.php 57 additions, 64 deletions...sext/redirects/Tests/Unit/Service/RedirectServiceTest.php
Please register or sign in to comment