Skip to content
Snippets Groups Projects
Commit b8f385b3 authored by Marc Bastian Heinrichs's avatar Marc Bastian Heinrichs Committed by Xavier Perseguers
Browse files

[TASK] Add default TypoScript setting for extbase query cache

The extbase query cache is enabled by default. This patch
adds a TypoScript setting to enable or disable the cache in general
and on a plugin level.

Resolves: #57280
Releases: 6.2
Change-Id: I620a3c4d2c4e508630d97731f12cc11c617aae75
Reviewed-on: https://review.typo3.org/29763
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Reviewed-by: Marcin Sągol
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
parent 81662133
Branches
Tags
No related merge requests found
......@@ -68,6 +68,9 @@ class QueryFactory implements QueryFactoryInterface, \TYPO3\CMS\Core\SingletonIn
$frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
$querySettings->setStoragePageIds(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $frameworkConfiguration['persistence']['storagePid']));
if ($querySettings instanceof Typo3QuerySettings) {
$querySettings->useQueryCache($frameworkConfiguration['persistence']['useQueryCache']);
}
$query->setQuerySettings($querySettings);
return $query;
}
......
......@@ -407,7 +407,7 @@ class Typo3QuerySettings implements QuerySettingsInterface {
* @return QuerySettingsInterface
*/
public function useQueryCache($useQueryCache) {
$this->useQueryCache = $useQueryCache;
$this->useQueryCache = (bool)$useQueryCache;
return $this;
}
......@@ -415,6 +415,6 @@ class Typo3QuerySettings implements QuerySettingsInterface {
* @return bool
*/
public function getUseQueryCache() {
return (bool)$this->useQueryCache;
return $this->useQueryCache;
}
}
......@@ -10,6 +10,7 @@ config.tx_extbase {
persistence{
enableAutomaticCacheClearing = 1
updateReferenceIndex = 0
useQueryCache = 1
classes {
TYPO3\CMS\Extbase\Domain\Model\FileMount {
mapping {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment