ProcessedResourceCache

class \TYPO3\CMS\Core\Resource\ProcessedResourceCache

Finds and persists ProcessedResource instances - the non-FAL counterpart to ProcessedFileRepository - without a database, keyed by the original resource's own identifier plus a content hash of its current bytes rather than an absolute filesystem path and modification time, which is unstable across a release-based deployment (see unify-fal-and-system-resource-processing.md §3.6 for the rationale).

Each original resource gets its own bounded subdirectory under typo3temp/assets/images/system/, named by a hash of its identifier; variants inside it are named by a hash of the task type and processing configuration, followed by the original's content hash. A result using the original as-is is recorded by a small JSON file of the same name instead. persistRender() removes sibling variants for the same configuration before writing a new one, so a changed original never leaves its stale render behind - the filesystem equivalent of what ProcessedFile::needsReprocessing() achieves with a database row - and that same bounded directory is what lets a future maintenance action reach exactly the non-FAL renders of one resource, rather than requiring a blanket sweep of the whole typo3temp/assets/images/ tree.

Table of Contents

Methods

add()  : void
Records a processing result that uses the original as-is, together with the properties its processor determined, so it is not processed again - the counterpart to ProcessedFileRepository::add() storing such a result in the database. A rendered variant needs no record, its file is found by its name.
findOneByOriginalAndTaskTypeAndConfiguration()  : ProcessedResource
persistRender()  : string
Moves an already-complete local file (e.g. GraphicalFunctions::resize()'s own, already-atomically-written, output) into this cache's bounded directory for the given processed resource's original and configuration, removing stale sibling variants for that same configuration first. Only ever called by ProcessedResource::updateWithLocalFile() - callers go through that, not this directly, so the resulting path only ever reaches this class and the ProcessedResource instance it belongs to.

Methods

add()

Records a processing result that uses the original as-is, together with the properties its processor determined, so it is not processed again - the counterpart to ProcessedFileRepository::add() storing such a result in the database. A rendered variant needs no record, its file is found by its name.

public add(ProcessedResource $processedResource) : void

Parameters

$processedResource : ProcessedResource

persistRender()

Moves an already-complete local file (e.g. GraphicalFunctions::resize()'s own, already-atomically-written, output) into this cache's bounded directory for the given processed resource's original and configuration, removing stale sibling variants for that same configuration first. Only ever called by ProcessedResource::updateWithLocalFile() - callers go through that, not this directly, so the resulting path only ever reaches this class and the ProcessedResource instance it belongs to.

public persistRender(ProcessedResource $processedResource, string $temporaryLocalFilePath) : string

Parameters

$processedResource : ProcessedResource
$temporaryLocalFilePath : string

Return values

string
On this page