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

How do I enable file caching?

Brogan

XenForo moderator
Staff member
#3
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
 

Cezz

Well-known member
#4
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
Why don't you use a filecache? No additional software to be installed only requires some permission changes... ok not the best but better than no cache at all!
 

Cezz

Well-known member
#8
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
 

Cezz

Well-known member
#10
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
 

ChemicalKicks

Well-known member
#11
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? :)
 

Cezz

Well-known member
#12
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.
 

Kier

XenForo Developer
Staff member
#13
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.
 

Cezz

Well-known member
#16
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!
 

Brogan

XenForo moderator
Staff member
#17
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.
 

ChemicalKicks

Well-known member
#20
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?