Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.19.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Jul 1, 2024
2 parents 54847f0 + 391e7ef commit cd3d3e4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Config/WfdMetaConfigCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,20 @@ public function isWfdMetaFresh(): bool

public function write($content, array $metadata = null): void
{
/** @var WfdMetaResource[] $wfdMetaResources */
$this->innerCache->write($content, $metadata);

// Create an extra cache layer by collecting all WfdMetaResources, fetching the current
// timestamp for the data they represent and put everything together into an extra
// `.wfd_meta` metadata file.

$wfdMetaResources = [];

foreach ($metadata as $key => $resource) {
if ($resource instanceof WfdMetaResource) {
unset($metadata[$key]);
$wfdMetaResources[(string) $resource] = $resource; // use key to dedup resource
}
}

$this->innerCache->write($content, $metadata);

$timestamp = null;

if ($wfdMetaResources) {
Expand Down

0 comments on commit cd3d3e4

Please sign in to comment.