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

XF 1.3 Setting Up Cache

Discussion in 'XenForo Questions and Support' started by Divvens, May 30, 2014.

  1. Divvens

    Divvens Well-Known Member

    I followed the instructions here: http://xenforo.com/help/cache/

    This is currently in my config.php file
    PHP:
    $config['cache']['enabled'] = true$config['cache']['frontend'] = 'Core'$config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_'$config['cache']['backend'] = 'File';
    I've read that you also need to assign a file directory of some sort for the Cache to properly work? I'm on "Semi-Dedicated" hosting (it is still shared in a sense, not a vps/dedicated server.) and I wish to utilize the default caching method nothing else.

    Do I need to add anything else/do anything else in order to get the Cache working properly?
     
  2. Divvens

    Divvens Well-Known Member

    Well, I turned on debug mode and checked, it seems that the cache is working properly but i'm no expert at this. Anyways, are the following statistics good? :eek:

     
  3. tajhay

    tajhay Well-Known Member

    What were the statistics before?
     
  4. Divvens

    Divvens Well-Known Member

    I have no idea, I didn't check the statistics before and I don't know if removing the cache options would be a good idea.
     
  5. Divvens

    Divvens Well-Known Member

    I still want to know if what I mentioned in the first post (the process mentioned in the official document) is the only process that needs to be followed for setting up the file cache right or do I need to do anything additional.
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    I used to use this when I was on a shared server:
    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['cacheSessions'] = true;
    $config['cache']['backend'] = 'File';
    $config['cache']['backendOptions'] ['cache_dir'] = '/path/to/cache';
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions'] ['cache_id_prefix'] = 'xf_';
     
    apsmith21 and Divvens like this.
  7. Divvens

    Divvens Well-Known Member

    Yea, I wanted to know if the cache_dir is required as it isn't mentioned in the official documentation, should I also add a path to cache or let it be default the way it is (without directory path)?

    And if I need to add a path, should I create a new directory (if yes, then where?)
     
  8. RoldanLT

    RoldanLT Well-Known Member

    That's not bad for a shared hosting.
     
    Divvens likes this.
  9. Divvens

    Divvens Well-Known Member

    It's semi-dedicated, and the host is awesome :p

    I'm still confused whether I should add a cache directory and path to it, or not since the official documentation says nothing about a path yet people use a path, if its something that needs to be there for it to work wouldn't it be mentioned in the documents? I'm a noob with it thus confused!
     
  10. tajhay

    tajhay Well-Known Member

    Yeah i agree @Divvens, i would like clarification on that too.

    Also once the cache has been setup, is there anywhere to check that its actually working? Should the cache directory start getting files in there?
     
  11. Tracy Perry

    Tracy Perry Well-Known Member

    I would assume by the statement on the advanced options in the manual page that states
    that it places them in /tmp unless you tell it somewhere else. In fact, when you go to the Full List of File Cache Options on that page it tells you that by default it places them in the system temp directory which on a VPS/dedi will be in /tmp (again usually).

    Screen Shot 2014-06-02 at 3.04.52 AM.png

    On a shared hosting - I'm not sure (I never used it much) but I'm sure that each shared hosting account has a /tmp directory for it also.
     
  12. Divvens

    Divvens Well-Known Member

    Indeed, there is a /tmp directory on my server but I don't see any recent files in it, nor do I know infact what cache files are saved as.

    Do you suggest me creating a new directory for the cache files? Or should I just let it be as it is now, since it does seem to be working.

    I think the directory should start storing files, but I may be wrong.
     
  13. RoldanLT

    RoldanLT Well-Known Member

    When I'm still on Shared Host, this is my config:
    Code:
        // Cache
        $config['cache']['enabled'] = true;
        $config['cache']['frontend'] = 'Core';
        $config['cache']['cacheSessions'] = true;
      
      
        // File Cache
        $config['cache']['backend'] = 'File';
        $config['cache']['backendOptions'] = array('cache_dir'  => 'full_path_to/internal_data/cache');
        $config['cache']['frontendOptions'] = array('caching'  =>  true,
                                                    'automatic_serialization' => true,
                                                    'lifetime'    => 1800,
                                                    'cache_id_prefix'  =>  'xf_'
        );
        // End File Cache
    
    
    Yes you should declare the path, and also you must create it manually and chmod 777.
     
    nttruong and Divvens like this.
  14. Tracy Perry

    Tracy Perry Well-Known Member

    There is also a /temp directory in your forum setup under the /internal_data. I bet that's where they go by default.

    Screen Shot 2014-06-02 at 5.23.43 AM.png
     
    Divvens likes this.
  15. Divvens

    Divvens Well-Known Member

    Must the directory be located inside the internal data directory?
     
  16. Tracy Perry

    Tracy Perry Well-Known Member

    You can locate it anywhere the http server can get to I'm sure... but by default I'm pretty sure it's that one in the internal_data/temp location.
     
    Divvens likes this.
  17. DRaver

    DRaver Active Member

    What must in the config file, if i only use opcache php 5.5?
     
  18. Tracy Perry

    Tracy Perry Well-Known Member

    For php caching? Just be sure you define a memory amount for it in your php.ini. No additional settings are necessary.
    It doesn't have the same features that xCache does and all you can use it for is php opcode caching. If you want to do more then you need to install APCu or memcached.
     
  19. DRaver

    DRaver Active Member

    Okay and what must in the ini, if i have apcu installed?
     
  20. Tracy Perry

    Tracy Perry Well-Known Member

    If it is backwards compatible with APC then the info on this page should get you going.
     

Share This Page