Skip to content

Commit e72ce0b

Browse files
committed
chore: removed no-cache directive from CacheBuilder defaults
1 parent e08db0e commit e72ce0b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Builder/CacheBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function __construct(
1111
private CacheItemPoolInterface $pool,
1212
private ?int $ttl = 60,
1313
private array $methods = [Method::GET, Method::HEAD],
14-
private array $responseCacheDirectives = ['no-cache', 'max-age']
14+
private array $responseCacheDirectives = ['max-age']
1515
) {}
1616

1717
public function getPool(): CacheItemPoolInterface

tests/Unit/Builder/CacheBuilderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ public function testDefaults()
1717
$this->assertInstanceOf(CacheItemPoolInterface::class, $cacheBuilder->getPool());
1818
$this->assertSame(60, $cacheBuilder->getTtl());
1919
$this->assertSame(['GET', 'HEAD'], $cacheBuilder->getMethods());
20-
$this->assertSame(['no-cache', 'max-age'], $cacheBuilder->getResponseCacheDirectives());
20+
$this->assertSame(['max-age'], $cacheBuilder->getResponseCacheDirectives());
2121
}
2222

2323
public function testDependencyInjection()
2424
{
2525
$pool = $this->createMock(CacheItemPoolInterface::class);
2626
$ttl = 600;
2727
$methods = ['GET'];
28-
$responseCacheDirectives = ['max-age'];
28+
$responseCacheDirectives = ['no-cache', 'max-age'];
2929

3030
$cacheBuilder = new CacheBuilder($pool, $ttl, $methods, $responseCacheDirectives);
3131

@@ -40,7 +40,7 @@ public function testSetters()
4040
$pool = $this->createMock(CacheItemPoolInterface::class);
4141
$ttl = 600;
4242
$methods = ['GET'];
43-
$responseCacheDirectives = ['max-age'];
43+
$responseCacheDirectives = ['no-cache', 'max-age'];
4444

4545
$cacheBuilder = new CacheBuilder($pool);
4646
$cacheBuilder->setPool($pool);

0 commit comments

Comments
 (0)