From 3179154ee554e2d04bdaeb0bd62b0221f1370442 Mon Sep 17 00:00:00 2001 From: Bastien Lutz Date: Thu, 28 May 2026 15:23:32 +0200 Subject: [PATCH] [BUGFIX] Don't cache pages during solr indexing In EXT:solr version 14, indexing requests are executed via subrequests instead of HTTP/HTTPS. Additionally, query parameters were moved to a custom request attribute `solr.indexingInstructions`, which still allows identifying indexing requests. Due to the change to subrequests, it seems necessary to also trigger the `SolrIndexingProcessListener` with the CacheRuleEvent (PrepareMiddleware). Resolves: #464 --- Classes/Cache/Listener/SolrIndexingProcessListener.php | 6 +++--- Configuration/Services.yaml | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Classes/Cache/Listener/SolrIndexingProcessListener.php b/Classes/Cache/Listener/SolrIndexingProcessListener.php index 77a3a97dce0..664da7798f0 100644 --- a/Classes/Cache/Listener/SolrIndexingProcessListener.php +++ b/Classes/Cache/Listener/SolrIndexingProcessListener.php @@ -4,16 +4,16 @@ namespace SFC\Staticfilecache\Cache\Listener; -use SFC\Staticfilecache\Event\CacheRuleFallbackEvent; +use SFC\Staticfilecache\Event\CacheRuleEventInterface; /** * Solr Indexing process. */ class SolrIndexingProcessListener { - public function __invoke(CacheRuleFallbackEvent $event): void + public function __invoke(CacheRuleEventInterface $event): void { - if ($event->getRequest()->hasHeader('X-Tx-Solr-Iq')) { + if ($event->getRequest()->getAttribute('solr.indexingInstructions', null) !== null) { $event->addExplanation(__CLASS__, 'Solr Indexing request'); $event->setSkipProcessing(true); } diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 919632a28c3..add016e88da 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -58,6 +58,9 @@ services: - name: event.listener identifier: 'SolrIndexingProcessListenerFallback' event: SFC\Staticfilecache\Event\CacheRuleFallbackEvent + - name: event.listener + identifier: 'SolrIndexingProcessListener' + event: SFC\Staticfilecache\Event\CacheRuleEvent SFC\Staticfilecache\Cache\Listener\T3CrawlerIndexingProcessListener: tags: