Skip to content

Commit 9b52f6c

Browse files
committed
Limit cache size to 256 results by default
1 parent 1b5e3aa commit 9b52f6c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Resolver/Factory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ public function create($nameserver, LoopInterface $loop)
2626

2727
public function createCached($nameserver, LoopInterface $loop, CacheInterface $cache = null)
2828
{
29+
// default to keeping maximum of 256 responses in cache unless explicitly given
2930
if (!($cache instanceof CacheInterface)) {
30-
$cache = new ArrayCache();
31+
$cache = new ArrayCache(256);
3132
}
3233

3334
$nameserver = $this->addPortToServerIfMissing($nameserver);

0 commit comments

Comments
 (0)