Bug #89716
closedidentifier not null in sys_file_processedfile
100%
Description
I'm running a TYPO3 v9.5.11 with an implementation of adaptive images which leads to a huge amount of processed files.
Additionally if have upscaling disabled:
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_allowUpscaling'] = false;
So in many cases the original files should get rendered in fe without processing.
This change led to a performance slump, which was inexplicable to me.
During my research i have found some processed files in the database, which are updated on every request even if the page should be cached.
These entries have the following properties set:
identifier='' name=null
After more search I came to bug #62400 which is "Rejected" and points me to the TYPO3\CMS\Core\Resource\ProcessedFile:
* A file may also meet the expectations set in the configuration without any processing. In that case, the * ProcessedFile object still exists, but there is no physical file directly linked to it. Instead, it then * redirects most method calls to the original file object. The data of these objects are also stored in the * database, to indicate that no processing is required. With such files, the identifier and name fields in the * database are empty to show this.
Therefore, the existence of these entries is correct. But i think these properties should have the same value (null) in the database:
identifier=null name=null
These files are always touched while the condition never matches in \TYPO3\CMS\Core\Resource\ProcessedFile::usesOriginalFile
public function usesOriginalFile()
{
return $this->identifier === null || $this->identifier === $this->originalFile->getIdentifier();
}
or in \TYPO3\CMS\Core\Resource\ProcessedFile::updateWithLocalFile
if ($this->identifier === null) {
throw new \RuntimeException('Cannot update original file!', 1350582054);
}
To fix this the database structure should get fixed.
The identifier is created like this:
identifier varchar(512) DEFAULT '' NOT NULL,
But the default should be NULL
identifier varchar(512) DEFAULT NULL,
Only in this case, the condition matches and the files are not constantly updated.