Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How to enable cache in Q2A 1.8 beta 1?

+2 votes
asked Nov 8, 2017 in Q2A Core by Gurjyot Singh
I tried to enable cache in admin section but it says that Cache director is not found? Actually, it's not written anywhere that a cache directory is needed to activate cache and exactly where the directory should be placed? Moreover, what "cache" be the exact name of the directory?
Q2A version: 1.8 beta 1

2 Answers

+2 votes
answered Nov 8, 2017 by fara
I don't have q2a version 1.8 but Did you look at this: https://github.com/q2a/question2answer/blob/dev/qa-config-example.php#L89 ?
commented Nov 8, 2017 by Gurjyot Singh
Thanks a lot for your answer, yes you pointed at the right place but, I am still facing some problem there. Let's see if I get it fixed soon. :)
+2 votes
answered Nov 8, 2017 by ProThoughts
edited Nov 8, 2017 by ProThoughts

fara mentioned steps are correct. I enabled cache on http://meta.question2answer.info site, you can test for speed. so far no issues seen.

To enable caching, the following steps need to be taken:

  1. Make a folder to store the cache files and chmod it to 777. Note: for security reasons the folder must be outside your document root. In other words you must not be able to view cache files in your browser like example.com/cache/123abc456def
  2. Set the QA_CACHE_DIRECTORY constant in qa-config.php to the location you made above (see qa-config-example.php for an explanation).
  3. Go to Admin > Caching and tick "Enable caching".
  4. Caching driver-> filesystem

commented Nov 10, 2017 by Gurjyot Singh
I have written that line outside the comment and also defined the right path. If it wouldn't be outside comment then I would be getting an error like "No directory defined" or something like that.
commented Nov 10, 2017 by ProThoughts
can you PM me exact path which is written in below line
define('QA_CACHE_DIRECTORY', '/path/to/writable_cache_directory/');