Skip to content

Commit 6d20b53

Browse files
committed
Add default TTL
1 parent 59e34a1 commit 6d20b53

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

app/Config/Cache.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,21 @@ class Cache extends BaseConfig
8282
*/
8383
public $prefix = '';
8484

85+
/**
86+
* --------------------------------------------------------------------------
87+
* Default TTL
88+
* --------------------------------------------------------------------------
89+
*
90+
* The default number of seconds to save items when none is specified.
91+
*
92+
* WARNING: This is not used by framework handlers where 60 seconds is
93+
* hard-coded, but may be useful to projects and modules. This will replace
94+
* the hard-coded value in a future release.
95+
*
96+
* @var integer
97+
*/
98+
public $ttl = 60;
99+
85100
/**
86101
* --------------------------------------------------------------------------
87102
* File settings

user_guide_src/source/libraries/caching.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ more complex, multi-server setups.
5959
If you have more than one application using the same cache storage, you can add a custom prefix
6060
string here that is prepended to all key names.
6161

62+
**$ttl**
63+
64+
The default number of seconds to save items when none is specified.
65+
WARNING: This is not used by framework handlers where 60 seconds is hard-coded, but may be useful
66+
to projects and modules. This will replace the hard-coded value in a future release.
67+
6268
**$file**
6369

6470
This is an array of settings specific to the ``File`` handler to determine how it should save the cache files.

0 commit comments

Comments
 (0)