Skip to content

Commit 2209746

Browse files
committed
Merge branch 'trickreich-bugfix/symfony-support-tag'
2 parents 6552fb1 + 9a70383 commit 2209746

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ Changelog
33

44
See also the [GitHub releases page](https://github.com/FriendsOfSymfony/FOSHttpCache/releases).
55

6+
2.5.1
7+
-----
8+
9+
### Symfony
10+
11+
* Have cache invalidator check for presence of Psr6Store for a better guess
12+
whether the cache really is TagCapable or not.
13+
614
2.5.0
715
-----
816

src/CacheInvalidator.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
use FOS\HttpCache\ProxyClient\Invalidation\RefreshCapable;
2222
use FOS\HttpCache\ProxyClient\Invalidation\TagCapable;
2323
use FOS\HttpCache\ProxyClient\ProxyClient;
24+
use FOS\HttpCache\ProxyClient\Symfony;
2425
use Symfony\Component\EventDispatcher\EventDispatcher;
2526
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
27+
use Toflar\Psr6HttpCacheStore\Psr6Store;
2628

2729
/**
2830
* Manages HTTP cache invalidation.
@@ -97,7 +99,12 @@ public function supports($operation)
9799
case self::INVALIDATE:
98100
return $this->cache instanceof BanCapable;
99101
case self::TAGS:
100-
return $this->cache instanceof TagCapable;
102+
$supports = $this->cache instanceof TagCapable;
103+
if ($supports && $this->cache instanceof Symfony) {
104+
return class_exists(Psr6Store::class);
105+
}
106+
107+
return $supports;
101108
default:
102109
throw new InvalidArgumentException('Unknown operation '.$operation);
103110
}

0 commit comments

Comments
 (0)