1. 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

Discussion in 'XenForo Questions and Support' started by mrGTB, Nov 9, 2011.

  1. mrGTB

    mrGTB Well-Known Member

    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.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    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.).
     
  3. mrGTB

    mrGTB Well-Known Member

    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.
     
  4. jauburn

    jauburn Well-Known Member

    Is that all? The minify option in the ACP says you have to modify the config.php file as well. Is that a requirement?
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    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_';
     
    maszd likes this.
  6. jauburn

    jauburn Well-Known Member

    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?
     
  7. mrGTB

    mrGTB Well-Known Member

    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
    );
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Not on my live site, but I am on localhost.
     
  9. swatme

    swatme Well-Known Member

    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);
     
  10. mrGTB

    mrGTB Well-Known Member

    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.
     

Share This Page