Skip to content

Add default TTL #4742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions app/Config/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@ class Cache extends BaseConfig
*/
public $prefix = '';

/**
* --------------------------------------------------------------------------
* Default TTL
* --------------------------------------------------------------------------
*
* The default number of seconds to save items when none is specified.
*
* WARNING: This is not used by framework handlers where 60 seconds is
* hard-coded, but may be useful to projects and modules. This will replace
* the hard-coded value in a future release.
*
* @var integer
*/
public $ttl = 60;

/**
* --------------------------------------------------------------------------
* File settings
Expand Down
6 changes: 6 additions & 0 deletions user_guide_src/source/libraries/caching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ more complex, multi-server setups.
If you have more than one application using the same cache storage, you can add a custom prefix
string here that is prepended to all key names.

**$ttl**

The default number of seconds to save items when none is specified.
WARNING: This is not used by framework handlers where 60 seconds is hard-coded, but may be useful
to projects and modules. This will replace the hard-coded value in a future release.

**$file**

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