diff --git a/inc/config.php b/inc/config.php index d399e69c..e941d6df 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1715,3 +1715,6 @@ // Use oekaki? $config['oekaki'] = false; + + // Twig cache? + $config['twig_cache'] = false; diff --git a/inc/instance-config.php b/inc/instance-config.php index 9c8a326c..b5c93333 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -213,8 +213,10 @@ $config['show_sages'] = false; $config['katex'] = false; $config['enable_antibot'] = false; $config['spam']['unicode'] = false; +$config['twig_cache'] = true; // 8chan specific mod pages require '8chan-mod-pages.php'; // Load database credentials require "secrets.php"; + diff --git a/inc/template.php b/inc/template.php index b0d7bfb2..c45fd140 100644 --- a/inc/template.php +++ b/inc/template.php @@ -23,7 +23,7 @@ function load_twig() { $loader->setPaths($config['dir']['template']); $twig = new Twig_Environment($loader, array( 'autoescape' => false, - 'cache' => is_writable('templates') || (is_dir('templates/cache') && is_writable('templates/cache')) ? + 'cache' => (is_writable('templates') || (is_dir('templates/cache') && is_writable('templates/cache'))) && $config['twig_cache'] ? "{$config['dir']['template']}/cache" : false, 'debug' => $config['debug'] ));