Skip to content

Commit

Permalink
Cache key needs to be unique for each entry (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni authored Nov 1, 2024
1 parent e3c4b37 commit 0ac5579
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Listeners/ProcessImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function handle(EntrySaved $event): void
watermark: $event->entry->watermark,
lowres: $event->entry->lowres,
),
fn () => Cache::forget('processed_images'),
fn () => Cache::forget("{$event->entry->id()}-processed-images"),
])->dispatch();
}

Expand Down
2 changes: 1 addition & 1 deletion app/Providers/ComputedPropertiesProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function boot(): void
});

Collection::computed('private_galleries', 'processed_images', function ($entry, $value) {
return Cache::rememberForever('processed_images', function () use ($entry) {
return Cache::rememberForever("{$entry->id()}-processed-images", function () use ($entry) {
$images = $entry->get('assets');

if (empty($images)) {
Expand Down

0 comments on commit 0ac5579

Please sign in to comment.