Skip to content
  • Stefan Bürk's avatar
    [BUGFIX] Use clustered cache entries per domain for redirects · 8d709070
    Stefan Bürk authored and Benni Mack's avatar Benni Mack committed
    '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/+/73118
    
    
    Tested-by: default avatarOliver Bartsch <bo@cedev.de>
    Tested-by: default avatarcore-ci <typo3@b13.com>
    Tested-by: default avatarBenni Mack <benni@typo3.org>
    Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
    Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
    Reviewed-by: default avatarBenni Mack <benni@typo3.org>
    8d709070