title: Doctrine query_cache_driver doesn't seem to cache query in symfony
body: <p>I'm either misunderstanding the <a href="http://symfony.com/doc/current/reference/configuration/doctrine.html" rel="nofollow noreferrer">query_cache_driver</a> or doing something wrong or missing a small footprint somewhere so I'm happy to blame myself here. When activated, even though the query is changed by user, is it not supposed to be using cached query instead of changed one? Please see the example below.</p>
  
  <p><strong>NOTE:</strong> I'm on <code>dev</code> mode so calling <code>http://my.local/app_dev.php/backend/league</code> and using <a href="https://github.com/jithinjose2/APC-Admin" rel="nofollow noreferrer">APC Admin</a> for stats.</p>
  
  <p><strong>config_dev.yml</strong></p>
  
  <pre><code>doctrine:
      dbal:
          driver:   pdo_mysql
          host:     "%database_host%"
          port:     "%database_port%"
          dbname:   "%database_name%"
          user:     "%database_user%"
          password: "%database_password%"
          charset:  UTF8
      orm:
          auto_generate_proxy_classes: "%kernel.debug%"
          naming_strategy: doctrine.orm.naming_strategy.underscore
          auto_mapping: true
          query_cache_driver: apc
  </code></pre>
  
  <p><strong>THIS IS WITH NO CACHE AT ALL</strong></p>
  
  <pre><code>public function findAll()
  {
      $qb = $this-&gt;createQueryBuilder('l')
          -&gt;select('l')
          -&gt;orderBy('l.name', 'ASC')
          -&gt;getQuery();
  
      $qb = $qb-&gt;getResult();
  
      return $qb;
  }
  
  SELECT 
    l0_.id AS id0, 
    l0_.name AS name1 
  FROM 
    league l0_ 
  ORDER BY 
    l0_.name ASC
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/bwaeF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bwaeF.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/k486u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k486u.png" alt="enter image description here"></a></p>
  
  <p><strong>THIS IS BEFORE CHANGING THE QUERY AND CACHE ACTIVATED</strong></p>
  
  <pre><code>public function findAll()
  {
      $qb = $this-&gt;createQueryBuilder('l')
          -&gt;select('l')
          -&gt;orderBy('l.name', 'ASC')
          -&gt;getQuery()
          -&gt;useQueryCache(true);
  
      $qb = $qb-&gt;getResult();
  
      return $qb;
  }
  
  SELECT 
    l0_.id AS id0, 
    l0_.name AS name1 
  FROM 
    league l0_ 
  ORDER BY 
    l0_.name ASC
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mCrix.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mCrix.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/9VzEj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9VzEj.png" alt="enter image description here"></a></p>
  
  <p><strong>THIS IS AFTER CHANGING THE QUERY AND CACHE ACTIVATED</strong></p>
  
  <p>Is this not supposed to be the same as above if the <code>query_cache_driver</code> caches the queries? As you can see both images are the same.</p>
  
  <pre><code>public function findAll()
  {
      $qb = $this-&gt;createQueryBuilder('l')
          -&gt;select('l')
          -&gt;getQuery()
          -&gt;useQueryCache(true);
  
      $qb = $qb-&gt;getResult();
  
      return $qb;
  }
  
  SELECT 
    l0_.id AS id0, 
    l0_.name AS name1 
  FROM 
    league l0_
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6JiCw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6JiCw.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/Vyqj6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vyqj6.png" alt="enter image description here"></a></p>