How to know cache is working?

craigiri

Well-known member
Based on the cache suggestions given here:
http://xenforo.com/help/cache/

How does one know that cache is working?

Specifically, in the first two instances, cache front end and back end file store, is there a place on my server where the files are kept so that I can confirm that things are working? Would the config throw an error if it was not?

Also, is file back end store really any better than the built-in Linux (and other nix) automatic caching of virtually all served data?

Someone should write up a white paper on ALL these items!

Any info welcome!
 
Thanks Jake...but neither of the first two options at:
http://xenforo.com/help/cache/
specify a directory!

The first specifies a prefix, which I have looked for files with "xf_" or "xf_*" and not found any related to cache.

Maybe I'll try the debug mode - but it would sure be nice to know where the gears are! I see that the Zend page says it would be the "default system temp" directory, but cannot find where that might be. My guess is that I may have to specify one in the directory with xf since it may not have permission to write elsewhere - I can only assume that most hosts keep the temp or tmp directory in the same part of the tree as each specific user, as opposed to elsewhere.

Edit - it seems the problem is that there is no temp directory set. This must be set either through the config or at the file Zend/Cache/Backend/File.php

My first attempt at creating a directory and pointing to it failed - the whole site went down! Directory was writeable and full path from server root was specified. Maybe I have to just have path from Zend instance?
 
Ah, got it!

The path must be set from the XF root. I also put the tmp directory in that same root.

so, inside the file 'File.php" in Zend/Cache/Backend
you need to change as follows - it is set as null by default. I assume you could also specify this in the XF config.php with another line or array.

Code:
  protected $_options = array(
        'cache_dir' => 'tmp/',

and, of course, you must have a fully writeable and readable tmp directory inside your XF root directory!

So this is the file backend store.

My assumption is that the frontend is a memory based cache? In this case, there is no directory for it? Or should this one also exist somewhere?
 
Adding to this thread in case anyone else runs into this - I used redirects from my old forum, so each of these threw errors with the cache setup! This must be due to Zend looking for the tmp cache directory in the old file structure (for my old forum).

My quickie solution was to create tmp directories in one or two other directories where XF and Zend were looking for them!
 
Top Bottom