Skip to content

Commit 3a56658

Browse files
committed
Fixes after test in real application
1 parent 7fd8957 commit 3a56658

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/CachePlugin.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,19 @@ public static function clientCache(CacheItemPoolInterface $pool, StreamFactory $
6666
if (!in_array('no-cache', $config['respect_response_cache_directives'], true)) {
6767
$config['respect_response_cache_directives'][] = ['no-cache'];
6868
}
69+
if (!in_array('max-age', $config['respect_response_cache_directives'], true)) {
70+
$config['respect_response_cache_directives'][] = ['max-age'];
71+
}
6972
} else {
70-
$config['respect_response_cache_directives'] = ['no-cache'];
73+
$config['respect_response_cache_directives'] = ['no-cache', 'max-age'];
7174
}
7275

73-
self::__construct($pool, $streamFactory, $config);
76+
return new self($pool, $streamFactory, $config);
7477
}
7578

7679
public static function serverCache(CacheItemPoolInterface $pool, StreamFactory $streamFactory, array $config = [])
7780
{
78-
self::__construct($pool, $streamFactory, $config);
81+
return new self($pool, $streamFactory, $config);
7982
}
8083

8184
/**

0 commit comments

Comments
 (0)