XF 1.3 Is XenForo compatible with xcache.stat = Off?

Vladislav Rastrusny

Active member
Hello.

Could you please advice, if XenForo caching system is compatible with xCache with xcache.stat = Off (do not ever test if a file is changed on disk, always use cached version).

In this case after every rebuild operation (addon installation, style change etc.) I will need to invalidate xcache cache manually. But may be there are some other file caches, which are rebuild in the background by XenForo?
 
That should be fine, though I don't know if you'll get a significant benefit as there are still going to be stat calls happening (checking whether an autoload file exists, for example).
 
Ok, thanks.

The reason I'm going to turn stat off is to make server upgrades non-interrupting. Currently, when I deploy some PHP file from PHPStorm on server via SFTP, there is a short moment when file contents is incorrect to be executed because some user requested it while it was being updated in the file system.

Also this situation can lead to short time of library files inconsistencies. For example, the class I am uploading now has a newer interface, than that one on the server. And there will be a short time while a class with a changed interface is interacting with other classes, which expect older version etc.

I wanted to utilize xCache for this to make xCache keep compiled version even if I update it in a filesystem. When I'm finished uploading I just clear PHP cache and allow it to be filled by fresh files version.

Of course this can be solved by bringing application down, but our server is very busy and we try to keep it on zero downtimes.

Is there a better solution? How it is done here on XenForo.com? Did you actually close the forum upgrading it to 1.4?
 
That should be fine, though I don't know if you'll get a significant benefit as there are still going to be stat calls happening (checking whether an autoload file exists, for example).
Well, we encountered the following problem: with XCache stat=Off and storing templates in the file system there is an obvious problem - templates are not really updated when XenForo updates them. After any template modification, new page creation or anything else that is based on updating a template, you have to manually invalidate XCache PHP cache.

I've solved the problem by writting an addon which extends XenForo_DataWriter_Template and invalidates xCache php cache on _postSave. This incurs some excessive cache invalidations on addon installation/update where mass template rebuilds are in process, but under our load it currently works ok.
 
Top Bottom