1. QA_CACHE_DIRECTORY
The path can basically be whatever you like, as long as it's outside your webroot, but the FHS suggests /var/cache for cached application data. So, something like this should do:
define('QA_CACHE_DIRECTORY', '/var/cache/q2a/');
Note that this assumes you have root access to the server. Should that not be the case you need to pick a location where you have write access (but still outside the web root directory), for instance
define('QA_CACHE_DIRECTORY', '/home/u310886959/q2a-cache/');
If you're running several sites you should use separate caches per site, e.g.
define('QA_CACHE_DIRECTORY', '/home/u310886959/q2a-cache/example.com/');
3. QA_OPTIMIZE_DISTANT_DB
From the documentation:
Question2Answer is engineered to minimize the number of MySQL queries used per page. This allows you to separate your database and web servers without suffering too much from latency. The downside is that the resulting queries can be quite complex. If your database and web servers are running on the same box, latency is not an issue, so set QA_OPTIMIZE_LOCAL_DB to true and QA_OPTIMIZE_DISTANT_DB to false in qa-config.php. This will uses many simple MySQL queries instead of fewer complex ones.
However, the part about the the QA_OPTIMIZE_LOCAL_DB setting is apparently outdated according to the comments in the config:
The option QA_OPTIMIZE_LOCAL_DB is no longer used, since QA_OPTIMIZE_DISTANT_DB covers our uses.
If the database and application are running on the same server use the default setting
define('QA_OPTIMIZE_DISTANT_DB', false);
That will increase the number of queries against the database, but since no remote connection is involved the cost for that is cheap. For a remote database you want to reduce the number of connections to improve performance, because network traffic is expensive (compared to local connections). |