diff --git a/.gitignore b/.gitignore index 66b6c501..a8f1b1ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /public/include/config/global.inc.php /public/templates/compile/*.php /cronjobs/logs/*.txt +/public/templates/cache/*.php diff --git a/public/include/config/global.inc.dist.php b/public/include/config/global.inc.dist.php index 8bff1114..da41eb90 100644 --- a/public/include/config/global.inc.dist.php +++ b/public/include/config/global.inc.dist.php @@ -358,13 +358,20 @@ $config['cookie']['domain'] = ''; * * Ensure that the folder `templates/cache` is writable by the webserver! * - * Options: - * 0 = disabled - * 1 = enabled + * cache = Enable/Disable the cache + * cache_lifetime = Time to keep files in seconds before updating them * - * Default: - * 0 = disabled + * Options: + * cache: + * 0 = disabled + * 1 = enabled + * cache_lifetime: + * time in seconds + * + * Defaults: + * cache = 0, disabled + * cache_lifetime = 30 seconds **/ -$config['cache'] = 0; - +$config['smarty']['cache'] = 1; +$config['smarty']['cache_lifetime'] = 30; ?> diff --git a/public/include/smarty.inc.php b/public/include/smarty.inc.php index 8a320581..46a38750 100644 --- a/public/include/smarty.inc.php +++ b/public/include/smarty.inc.php @@ -20,6 +20,7 @@ $smarty->template_dir = BASEPATH . 'templates/' . THEME . '/'; $smarty->compile_dir = BASEPATH . 'templates/compile/'; // Optional smarty caching, check Smarty documentation for details -$smarty->caching = $config['cache']; +$smarty->caching = $config['smarty']['cache']; +$smarty->cache_lifetime = $config['smarty']['cache_lifetime']; $smarty->cache_dir = BASEPATH . "templates/cache"; ?>