This plugin is built for WordPress, so we don’t exactly program nor test for standalone functionality. I also don’t know if there is anyone who tried to achieve the same.
If you use the WordPress functions to query the database, the plugin can help caching queries/results. Otherwise you should just check the code for public functionality you could use, but I don’t think it’ll work actually.
There are definitely publicly available functions that many have used to do their own custom work but for me its been so long that I can no longer give you a starting guide. If someone had asked me 2 years ago i could have gone on and on with php calls. Nonetheless, it wasn’t difficult to peruse the code for answers.
Not sure how much (in terms of public function calls) is made available to you though. caching a page is definitely available. caching a dbase result…hmmm i dunno. I’ve never experimented with that feature. Obviously the call is there but the question is, is it publicly accessible .
w3tc is also compatible with WP-CLI if you want to run commands from command-line. Not sure how sophisticated 0.9.7 is compared to its w3tc-fixed cousin but its there.
I do use wordpress functionality to query the database. e.g. ->query, get_results ..etc but did a quick test and saw it wasn’t caching anything and not even showing my tables in the queries objects in debug comment. I’ll dig deeper and see if I can find functions to use.
Thanks