File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55namespace SFC \Staticfilecache \Cache \Listener ;
66
7- use SFC \Staticfilecache \Event \CacheRuleEvent ;
7+ use SFC \Staticfilecache \Event \CacheRuleEventInterface ;
88use TYPO3 \CMS \Frontend \Cache \CacheInstruction ;
99
1010class CachingAllowedListener
1111{
12- public function __invoke (CacheRuleEvent $ event ): void
12+ public function __invoke (CacheRuleEventInterface $ event ): void
1313 {
1414 if (!$ event ->getRequest ()->getAttribute ('frontend.cache.instruction ' , new CacheInstruction ())->isCachingAllowed ()) {
1515 $ event ->addExplanation (__CLASS__ , 'No caching via frontend.cache.instruction attribute ' );
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ class SolrIndexingProcessListener
1313{
1414 public function __invoke (CacheRuleFallbackEvent $ event ): void
1515 {
16+ // Note!! This is handled by old EXT:solr versions!!!
17+ // The new version set the 'frontend.cache.instruction' in the
18+ // right way and is cached via CachingAllowedListener.
19+
1620 if ($ event ->getRequest ()->hasHeader ('X-Tx-Solr-Iq ' )) {
1721 $ event ->addExplanation (__CLASS__ , 'Solr Indexing request ' );
1822 $ event ->setSkipProcessing (true );
Original file line number Diff line number Diff line change @@ -132,6 +132,9 @@ services:
132132 - name : event.listener
133133 identifier : ' CachingAllowedListener'
134134 event : SFC\Staticfilecache\Event\CacheRuleEvent
135+ - name : event.listener
136+ identifier : ' CachingAllowedListenerFallback'
137+ event : SFC\Staticfilecache\Event\CacheRuleFallbackEvent
135138
136139 SFC\Staticfilecache\Cache\Listener\NoUserOrGroupSetListener :
137140 tags :
You can’t perform that action at this time.
0 commit comments