• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

File Cache coding

#1
This is what I included in my config.php file:

$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';

$config['cache']['cacheSessions'] = true;

$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] = array('cache_dir' => 'internal_data/cache');



$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] = array('caching' => true,
'automatic_serialization' => true,
'lifetime' => 1800
);

The only other thing I did was to make a directory in internal_data labelled "cache", and change all the file permissions in internal_data to 777. Is that all I need to do? I'm not getting any errors on my homepage, but I was expecting something to happen. Am I leaving something out?
 

Brogan

XenForo moderator
Staff member
#2
You have the same line twice - $config['cache']['frontend'] = 'Core';

All you need for simple file caching is this:
Code:
$config['cache']['enabled'] = true;
$config['cache']['cacheSessions'] = true;
$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] ['cache_dir'] = '/path/to/internal_data/cache';
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] ['cache_id_prefix'] = 'xf_';