72904[BUGFIX] Avoid evaluating all regexp redirects if early match found
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Nikita Hovratov +1
- Oliver Hader +1
- Benni Mack +1
-
Verified V +2 Done
- Christian Kuhn +2
- Nikita Hovratov +1
- core-ci +1 CI
Issues 1
Files 1
Review log 1315
-
Stefan Bürk uploaded patch set 1 01/07/22, 14:21
-
Stefan Bürk marked it work in progress 01/07/22, 14:26
-
core-ci voted on patch set 1 V +1 01/07/22, 14:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21776
-
Stefan Bürk marked it ready for review 01/07/22, 14:55
-
Stefan Bürk wrote 01/07/22, 14:56
Topic set to Redirects -
Benni Mack updated the commit message in patch set 2 01/09/22, 12:57
-
Benni Mack voted on patch set 2 CR +1 01/09/22, 12:57
-
core-ci voted on patch set 2 V +1 01/09/22, 13:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21821
-
Oliver Hader commented on patch set 2 CR +1 01/14/22, 14:07
RedirectService.php:80`getFirstActiveRedirectFromPossibleRedirects` only uses active redirects. Maybe it's worth to extract `$activeRedirects` from `$allRedirects` here already and use those active items instead... -
Stefan Bürk commented on patch set 2 01/14/22, 14:31
RedirectService.php:80ReplyGenerally yes, but I had decided against that as this would end up in reading the whole cached multidimensional array, lopping over the whole structure and kicking off all "inactive" redirects and return a "cleanuped" copy of the orginial cached structure. ``` [ 'domain1' => [ 'flat' => ['key' => [...], 'key2' => [...]], 'respect_queryparameters => ['key' => [...], 'key2' => [...]], 'regexp' => ['key' => [...], 'key2' => [...]], ], 'domain2' => [ 'flat' => ['key' => [...], 'key2' => [...]], 'respect_queryparameters => ['key' => [...], 'key2' => [...]], 'regexp' => ['key' => [...], 'key2' => [...]], ], 'domain3' => [ 'flat' => ['key' => [...], 'key2' => [...]], 'respect_queryparameters => ['key' => [...], 'key2' => [...]], 'regexp' => ['key' => [...], 'key2' => [...]], ], 'domain4' => [ 'flat' => ['key' => [...], 'key2' => [...]], 'respect_queryparameters => ['key' => [...], 'key2' => [...]], 'regexp' => ['key' => [...], 'key2' => [...]], ], 'domain5' => [ 'flat' => ['key' => [...], 'key2' => [...]], 'respect_queryparameters => ['key' => [...], 'key2' => [...]], 'regexp' => ['key' => [...], 'key2' => [...]], ], 'domain6' => [ 'flat' => ['key' => [...], 'key2' => [...]], 'respect_queryparameters => ['key' => [...], 'key2' => [...]], 'regexp' => ['key' => [...], 'key2' => [...]], ], .... '*' => [ 'flat' => ['key' => [...], 'key2' => [...]], 'respect_queryparameters => ['key' => [...], 'key2' => [...]], 'regexp' => ['key' => [...], 'key2' => [...]], ], ] ``` Current solution would do this on matching "domain1" and "*", doing it as prposed beforehand it would do it for all of them. That would end up iteratating over the whole structure, and especially in installations with redirects of multiple also for all contained non-wildcard hosts, which on the otherhand would be a waste of "cleanup" time and task, as the current solution only takes current domain plus wildcard into account, iteratint them and stop on first active. I thought that this was the best compromise on each of these edge cases. Or did I missed a solution on here ? -
Nikita Hovratov voted on patch set 2 CR +1 01/14/22, 15:35
-
Christian Kuhn commented on patch set 2 V +1 CR +1 01/14/22, 17:39
RedirectService.php:80ReplyI'm fine with that. Since Lord Hader added +1 reading already, I guess he's fine, too. -
Nikita Hovratov voted on patch set 2 V +1 01/14/22, 18:18
-
Christian Kuhn voted on patch set 2 V +2 CR +2 01/14/22, 18:37
-
Christian Kuhn merged patch set 3 01/14/22, 18:37