Project

General

Profile

Actions

Feature #99843

open

Option to disable clearing sibling page cache (clearCache_pageSiblings)

Added by Joey Bouten almost 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Start date:
2023-02-06
Due date:
% Done:

0%

Estimated time:
PHP Version:
8.2
Tags:
cache
Complexity:
medium
Sprint Focus:

Description

We are currently running a installation with +40 languages. Saving pages kept getting slower lately.
After some research i came across the following behaviour:
Default is that when a page record is edited, the cache for itself, the parent, and siblings (same level) is cleared.

  • Products
  1. Product A
  2. Product B
  3. Product C
  • Information pages
  1. Information page 1
  2. Information page 2

Making a change on Product C page will always flush the cache on the Product A & B & C pages and its parent Products.
Including all the languages of those pages.
Its logical to me that Products (parent) cache is flushed.

Its not logical to me to flush all other Products on same level (siblings) since this could be over 1500 pages as is in our case.
An option called `clearCache_pageSiblings` would be nice for this.

Currently we've had to register a hook to solve this.

    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'][] =
        \BeechIt\XXXX\Hooks\ClearPageCacheEvalHook::class . '->dataHandlerClearPageCacheEval';
class ClearPageCacheEvalHook
{
    /**
     * @param $_params
     * @return void
     */
    public function dataHandlerClearPageCacheEval(&$_params): void
    {
        if ($_params['functionID'] === 'clear_cache()' && $_params['table'] === 'pages') {
            $_params['pageIdArray'] = [];
            $_params['pageIdArray'][] = $_params['uid'];
        }
    }
}


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Feature #100170: missing clearCache_pageSiblingsNew2023-03-15

Actions
Actions #1

Updated by Sven Ignor over 1 year ago

Actions

Also available in: Atom PDF