diff options
author | Andrew Dolgov <[email protected]> | 2017-05-29 23:14:42 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-05-29 23:14:42 +0300 |
commit | 6fd03996949f32f51bf5ba55bf50d10d1521f22d (patch) | |
tree | ff00bf86c8869d632557c4e20def2bb5720d42d1 /include | |
parent | 34a61a0c3c3d660145a11a9fd0aa3b517dc86180 (diff) |
tunables:
* add CACHE_MAX_DAYS as a tunable generic expiry interval for various cached files
* add some comments to tunables in functions.php
* rename _MIN_CACHE_FILE_SIZE to MIN_CACHE_FILE_SIZE
* respect MIN_CACHE_FILE_SIZE setting in a few more places where content is cached
Diffstat (limited to 'include')
-rw-r--r-- | include/functions.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/include/functions.php b/include/functions.php index a664212b2..6ea3e9ff2 100644 --- a/include/functions.php +++ b/include/functions.php @@ -30,17 +30,12 @@ /** * Define a constant if not already defined - * - * @param string $name The constant name. - * @param mixed $value The constant value. - * @access public - * @return boolean True if defined successfully or not. */ function define_default($name, $value) { defined($name) or define($name, $value); } - ///// Some defaults that you can override in config.php ////// + /* Some tunables you can override in config.php using define(): */ define_default('FEED_FETCH_TIMEOUT', 45); // How may seconds to wait for response when requesting feed from a site @@ -52,12 +47,18 @@ define_default('FILE_FETCH_CONNECT_TIMEOUT', 15); // How many seconds to wait for initial response from website when // fetching files from remote sites - - // feed updating stuff define_default('DAEMON_UPDATE_LOGIN_LIMIT', 30); + // stop updating feeds if users haven't logged in for X days define_default('DAEMON_FEED_LIMIT', 500); + // feed limit for one update batch define_default('DAEMON_SLEEP_INTERVAL', 120); - define_default('_MIN_CACHE_FILE_SIZE', 1024); + // default sleep interval between feed updates (sec) + define_default('MIN_CACHE_FILE_SIZE', 1024); + // do not cache files smaller than that (bytes) + define_default('CACHE_MAX_DAYS', 7); + // max age in days for various automatically cached (temporary) files + + /* tunables end here */ if (DB_TYPE == "pgsql") { define('SUBSTRING_FOR_DATE', 'SUBSTRING_FOR_DATE'); |