APC cache is used to store OPCode
if you want to store queries you should use Memcache
http://docs.doctrine-project.org/en/2.0.x/reference/caching.html#memcache
Edit 1 :
As you asked me to develop my answer I'll do so.
How PHP
works (simplified) ? RE2C
will first do a Lexical analysies (for >=PHP5.3 and Flex
for <=PHP5.2).
Tokens
are generated.
Then, the Parser have to analyze the tokens. For example it looks if you have a "(" after a function (T_FUNCTION, T_IF, T_OPEN
...) The parsers name is Bison
.
Then, your code is compiled in table of OPCode
.
For the end, there is an executer that will execute your code PHP
.
So if you want, just to execute your code and not analyze and parse.. so you can use a PHP accelerator
like APC
. So, your PHP
code will execute a lot faster but, the queries are executed every time you call your code. You're right, the documentation of Doctrine doesn't say it doesn't store the RESULT of queries but since it uses APC, it just stores THE QUERY.
Memcache
is a Distributed Object Caching Memory System, it stores the result of a query. It has a distributed server.
I hope I was more clear in this response, sorry if my english is not very well...