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

Fetch public templates as files and Minify CSS

mrGTB

Well-known member
#1
I'm not sure if I should activate either of these two settings using "File Cache". The settings are called "Fetch public templates as files and Minify CSS". Would I gain anything by doing so, or make matters worse. Keeping in mind I'm on shared hosting and only use the basic File Cache method.
 

Brogan

XenForo moderator
Staff member
#2
You can minify CSS with no issues.

To enable 'Fetch public templates as files' though, you need to have opcode cache installed on your server (APC, eAccelerator, XCache etc.).
 

mrGTB

Well-known member
#3
I thought that might be the case, that's how I just set them up, activate CSS but left the other disabled because of what you said it needs. Before I had the later enabled.
 

jauburn

Well-known member
#4
You can minify CSS with no issues.

To enable 'Fetch public templates as files' though, you need to have opcode cache installed on your server (APC, eAccelerator, XCache etc.).
Is that all? The minify option in the ACP says you have to modify the config.php file as well. Is that a requirement?
 

Brogan

XenForo moderator
Staff member
#5
You need to implement caching, as explained here: http://xenforo.com/help/cache/

For reference, this is in my config.php:
PHP:
$config['cache']['enabled'] = true;
$config['cache']['cacheSessions'] = true;
$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] ['cache_dir'] = '/path/to/cache/directory';
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] ['cache_id_prefix'] = 'xf_';
 

jauburn

Well-known member
#6
You need to implement caching, as explained here: http://xenforo.com/help/cache/

For reference, this is in my config.php:
PHP:
$config['cache']['enabled'] = true;
$config['cache']['cacheSessions'] = true;
$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] ['cache_dir'] = '/path/to/cache/directory';
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] ['cache_id_prefix'] = 'xf_';
Right. Well, you don't have examples for xcache on that page.

Also, if xcache is implemented on the server, is it necessary to change the config.php?
 

mrGTB

Well-known member
#7
You need to implement caching, as explained here: http://xenforo.com/help/cache/

For reference, this is in my config.php:
PHP:
$config['cache']['enabled'] = true;
$config['cache']['cacheSessions'] = true;
$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] ['cache_dir'] = '/path/to/cache/directory';
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] ['cache_id_prefix'] = 'xf_';
That's different from mine. How comes your using a cache_id_prefix, you running more than one forum?

Code:
$config['cache']['enabled'] = true;
$config['cache']['cacheSessions'] = true;
 
$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] = array('cache_dir'  => '/home/xxxxx/public_html/internal_data/file_cache');
 
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] = array('caching'  =>  true,
                                            'automatic_serialization' => true,
                                            'lifetime'    => 1800
);
 

swatme

Well-known member
#9
What is the advantage
of this
Code:
$config['cache']['frontendOptions'] ['cache_id_prefix'] = 'xf_';
over this
Code:
$config['cache']['frontendOptions'] = array('caching'  =>  true,
                                            'automatic_serialization' => true,
                                            'lifetime'    => 1800);
 

mrGTB

Well-known member
#10
If I'm correct the prefix should only be used if your running more than one instance of XenForo on the same server. If you running just the one forum it's of no use from what I've read with other forum software using that option. That's my general understanding of it's use.