From 43031b09dda3c8d4cbe551a076503bcd00d711c3 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Tue, 11 Feb 2025 17:22:14 +0000 Subject: [PATCH 1/2] fix#91: Change clientCache so it doesn't force no-cache & max-age response directives --- src/CachePlugin.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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']; } From 92b8dfac2e6b5108b08364b403dbb30fea680a6f Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Tue, 11 Feb 2025 17:27:44 +0000 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) 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