Skip to content

fix(feed-display): fix static cache key collision with multiple plugin instances - #16

Open
dkd-hauser wants to merge 1 commit into
ErHaWeb:mainfrom
dkd-hauser:main
Open

fix(feed-display): fix static cache key collision with multiple plugin instances#16
dkd-hauser wants to merge 1 commit into
ErHaWeb:mainfrom
dkd-hauser:main

Conversation

@dkd-hauser

@dkd-hauser dkd-hauser commented Aug 11, 2026

Copy link
Copy Markdown

Problem

The FeedController uses a hardcoded cache key (feeddisplay) shared across all plugin instances regardless of their individual settings (feed URL, date range, type etc.).

When more than one plugin element is configured with different settings, every request that hits an element whose settings differ from the currently cached ones causes a cache miss and overwrites the shared cache entry.

In practice this means caching is completely ineffective when multiple plugin elements with different settings are used on the same website.

Root Cause

// FeedController.php:38
$cacheIdentifier = 'feeddisplay'; // hardcoded — shared across all plugin elements

The settings comparison on line 45 ($data['settings'] !== $this->settings) was clearly intended to compensate for this, but has the opposite effect when multiple plugin elements are configured with different settings: each element invalidates the cache of every other.

Fix

Generate an instance-specific cache key based on an MD5 hash of the resolved plugin settings:

$cacheIdentifier = 'feeddisplay_' . md5(serialize($this->settings));

This gives each uniquely configured plugin element its own stable cache entry that is only rebuilt when its own settings change.

…n instances

## Problem

The `FeedController` uses a hardcoded cache key (`feeddisplay`) shared
across all plugin instances regardless of their individual settings
(feed URL, date range, type etc.).

With multiple instances configured with different settings, every request
that hits an instance whose settings differ from the currently cached ones
causes a cache miss and overwrites the shared cache entry. In practice
this means caching is completely ineffective when more than one instance
is deployed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant