Review main Abandoned

73195[WIP][FEATURE] Add option to recursive fetch data for config.cache

TYPO3com CR 0 V 0 Easy +21 −6 updated 11/27/24, 18:14

Commit message

This adds a third parameter to the `config.cache` configuration.
The parameter is optional set to false by default. Records from
any subfolder are considered in the calculation of the cache
lifetime by starttime/endtime.

The idea aims at pages with many nested sysfolders for records.
Specifying all the directories manually can be a lot of work.

Use it by adding a third parameter like in this example:
`config.cache.1234 = tx_my_table:4567:1`
to clear the cache on page 1234 when a record found in page 4567
or any nested subfolder reaches its starttime/endtime

----------------------------------------------------------------

todos:

* reimplement recursive pid determination from original patch
  in now moved in dedicated class and rethink about some details
* add tests ....
* add Feature ReST file

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 1017

  1. TYPO3com uploaded patch set 1 01/28/22, 20:44

  2. core-ci voted on patch set 1 V -1 01/28/22, 20:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22634

  3. Stefan Bürk commented on patch set 1 CR -1 01/29/22, 00:04

    Some first comments after a first quick look-through, thus -1 for now. Anyway, not sure about this at all. At least we need tests for this, on the other hand we should check if this option is passed/used somewhere else to clear caches - not sure about this. Have to recheck this. Will pick up this tomorrow.

    Unresolved

    Casing - should be '[FEATURE]'. Not sure about "option", is it really a option ? Maybe just me.

    TypoScriptFrontendController.php:3201 Unresolved

    Use an if/else condition to do the filter_var() only once. or at least to it before and save the result in a variable to be used in the conditions. Not getting the filter_var() yet at all .... maybe better checking this with a simple bool-type cast directly after unpacking the exploded array in L3150 and avoid these filter_var() calls here at all. Same fir condition in L3191.

    TypoScriptFrontendController.php:3204 Unresolved

    cgl issue - space must be removed (that's the cgl pipeline issue)

    TypoScriptFrontendController.php:3211 Unresolved

    Why changing this back to toe old onion-return type method ? Please leave this 'executeQuery()' to be expressive.
  4. Christian Kuhn commented on patch set 1 01/29/22, 11:25

    Ok, here is the thing: We all know this 'max' page cache lifetime calculation in FE is clumsy. The essential issue is here, that TSFE does not know which records are rendered on a page, and single record rendering does not notify TSFE about lifetime changes. This is a conceptual problem in FE rendering. The FE TS cache.config.pageId.x option is thus basically a hack to mitigate the underlying misconception by giving integrators a chance to obtain 'max' lifetime values from records if they *know* these records are used on a page - the classic example are news records with start/endtime in a sysfolder, used on some pages. We will have to tackle all that at some point, but it will be a bigger and possibly breaking thing, and we don't have a full concept for that right now as far as I know. The two questions we have to ask here: a) Does it actively help integrators if we further extend the given option with another feature? b) Will this feature actively hurt us when we start tackling the underlying issue? a) is obviously 'yes', otherwise we wouldn't see this patch. For b), looking at the code, the current implementation is "mostly harmless" and without many side effects. It shouldn't hurt much to have this. Thus, in general, I see no issue extending the config option with a recursive tree operation. The docs and the code should however state this is potentially expensive (if you're doing it wrong, the could would traverse *a huge tree* triggering tons of queries. Note: This part could be a target for a recursive CTE query, which would make it dramatically more efficient ... we *may* see something like that in v12. I'd thus say: "yeah, let's get it done if it helps people in general" plus "but document the risks, too".
  5. Thomas Anders commented on patch set 2 01/31/22, 21:39

    Published edit on patch set 1.
  6. core-ci voted on patch set 2 V -1 01/31/22, 21:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22829

  7. Thomas Anders commented on patch set 3 01/31/22, 22:12

    Published edit on patch set 2.
  8. core-ci voted on patch set 3 V -1 01/31/22, 22:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22832

  9. Thomas Anders uploaded patch set 4 02/09/22, 19:54

  10. core-ci voted on patch set 4 V -1 02/09/22, 20:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23300

  11. Thomas Anders uploaded patch set 5 02/09/22, 22:16

  12. core-ci voted on patch set 5 V -1 02/09/22, 22:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23306

  13. Stefan Bürk uploaded patch set 6 02/15/22, 23:43

  14. core-ci voted on patch set 6 V +1 02/15/22, 23:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23695

  15. Stefan Bürk commented on patch set 6 CR -1 02/17/22, 14:20

    blocked meanwhile. Benni is working on a handfull TSFE pre-patches, will pick up this then.
  16. Christian Kuhn commented on patch set 6 11/27/24, 18:14

    Hey. This patch was in limbo for quite a while now, and meanwhile - with the tsfe works in v13 - lifetime of page cache can be influenced much better, plus there is api to register 'used records' which will influence page lifetime as well. As such, I'd say, this patch is not the way to go anymore since ext authors have better ways to influence cache lifetimes now. I hope its ok to abandon here.
  17. Christian Kuhn abandoned the change 11/27/24, 18:14