Project

General

Profile

Actions

Bug #89716

closed

identifier not null in sys_file_processedfile

Added by Florian Schuhmann about 5 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2019-11-20
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #62400: Lot of entries in sys_file_processed with name=NULL and identifier emptyRejectedAndreas Wolf2014-10-22

Actions
Actions

Also available in: Atom PDF