Skip to content

Commit d7229fe

Browse files
committed
Fixed #313
1 parent f21a337 commit d7229fe

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/phpFastCache/CacheManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class CacheManager
5252
*/
5353
protected static $config = [
5454
'securityKey' => 'auto',// The securityKey that will be used to create sub-directory
55+
'defaultTtl' => 900,// Default time-to-live in second
5556
'htaccess' => true,// Auto-generate .htaccess if tit is missing
5657
'default_chmod' => 0777, // 0777 recommended
5758
'path' => '',// if not set will be the value of sys_get_temp_dir()

src/phpFastCache/Core/StandardPsr6StructureTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public function getItem($key)
6868
} else {
6969
$item->setHit(true);
7070
}
71+
} else {
72+
$item->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ]));
7173
}
7274

7375
}

0 commit comments

Comments
 (0)