jweiland-net / replacer

TYPO3 extension that replaces string patterns from the page. You can use it to replace URLs for Content Delivery Network (CDN). (Fork of ja_replacer)
GNU General Public License v2.0
1 stars 8 forks source link

Replacement not done when another listener disables caching #39

Open brotkrueml opened 5 months ago

brotkrueml commented 5 months ago

In the CacheableContentGeneratedEventListener it is checked if caching is enabled:

if (!$event->isCachingEnabled()) {
    return;
}

However, when EXT:yoast_seo is installed, the content is not replaced, as that extension provides a listener which sets caching to disabled when a specific HTTP header is set:

https://github.com/Yoast/Yoast-SEO-for-TYPO3/blob/main/Classes/Frontend/AfterCacheableContentIsGeneratedListener.php#L16

It seems this kicks in when logged-in in backend. Therefore, an editor cannot see the changes, as also the middleware (for non-cached content) does not kick in.

ste101 commented 4 months ago

Same here