How do I enable file caching?

It's a shame those of us without caching won't be able to utilise it.

That'll teach us to be tight gits and use shared hosting :D
 
Ah thanks guys, I'll look into that.

I'll speak to the host and see if it's possible.

Nothing to really talk to your host about, just edit your config file with the correct options and chmod the filecache folders :) that is unless you are on a 100% managed server
 
What do we need to add to the config!! :D

PHP:
$config['cache']['enabled'] = true;

$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] = array('cache_dir'  => '{{FULL PATH TO CACHE DIR}}');

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

Replacing the {{FULL PATH TO CACHE DIR}} To the full path to your cache dir, recomended is /library/cache
 
PHP:
$config['cache']['enabled'] = true;

$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] = array('cache_dir'  => '{{FULL PATH TO CACHE DIR}}');

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

Replacing the {{FULL PATH TO CACHE DIR}} To the full path to your cache dir, recomended is /library/cache
Cheers Cezz,

Couple of things, once I create the directory and add this to the config will it the directory start to populate with the caching stuff? I'm confused to how this works, with vBulletin I added a line to the config but it appeared to create the directory all by itself. :)

When you say full path to the cache would "/library/cache" be enough? :)
 
Cheers Cezz,

Couple of things, once I create the directory and add this to the config will it the directory start to populate with the caching stuff? I'm confused to how this works, with vBulletin I added a line to the config but it appeared to create the directory all by itself. :)

When you say full path to the cache would "/library/cache" be enough? :)

No it would need to be the FULL path I believe eg... /home/user/www/xenforo/library/cache or /www/var/user1/site1/library/cache

Honestly I am not 100% how it works but I think you need to create the folder and chmod it corrently and then yeah it starts to fill up with the required files.
 
PHP:
$config['cache']['enabled'] = true;

$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] = array('cache_dir'  => '{{FULL PATH TO CACHE DIR}}');

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

Replacing the {{FULL PATH TO CACHE DIR}} To the full path to your cache dir, recomended is /library/cache
FWIW, I'd recommend internal_data/cache, for ease of use.
 
Thanks guys.

Surprised it has to be an absolute full path rather than relative.

I might be wrong about that mind you, either way I would use an absolute path so I know exactly where the cache is going as it could even be outside of your public_html folder if you wanted for some reason!
 
Yay!
Just tested it on my local and it works fine :)

You need to manually create the internal_data/cache directory otherwise you get an exception thrown.

Thanks again guys.
 
Yay!
Just tested it on my local and it works fine :)

You need to manually create the internal_data/cache directory otherwise you get an exception thrown.

Thanks again guys.

Hey Brogan,
Glad you got it working.

I got an exception and I created the folder :eek: What path format you using I tried the auld /home/user/public/ETC but that threw up an exception with this in the error.

"/var/sites/t/the-sps.org/public_html/library/config.php" so should I be using somthing like the following....

"/var/sites/t/the-sps.org/public_html/internal_data/cache" should I have a / on the end of that?
 
Top Bottom