diff --git a/CHANGELOG.md b/CHANGELOG.md index b859565..a5f7d6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +# Version 3 + +## 3.0.0 - 2025-XX-XX + +### Changed + - `clientCache()` will no longer force no-cache & max-age directives to be respected even when `respect_response_cache_directives` is set. + # Version 2 ## 2.0.1 - 2024-10-02 diff --git a/src/CachePlugin.php b/src/CachePlugin.php index 6afb03e..00de64b 100644 --- a/src/CachePlugin.php +++ b/src/CachePlugin.php @@ -95,11 +95,7 @@ public function __construct(CacheItemPoolInterface $pool, StreamFactoryInterface public static function clientCache(CacheItemPoolInterface $pool, StreamFactoryInterface $streamFactory, array $config = []) { // Allow caching of private requests - if (\array_key_exists('respect_response_cache_directives', $config)) { - $config['respect_response_cache_directives'][] = 'no-cache'; - $config['respect_response_cache_directives'][] = 'max-age'; - $config['respect_response_cache_directives'] = array_unique($config['respect_response_cache_directives']); - } else { + if (!\array_key_exists('respect_response_cache_directives', $config)) { $config['respect_response_cache_directives'] = ['no-cache', 'max-age']; }