Skip to content


DDC-1216: A way to mark an entity to always use result cache. Like @UseResultCache class annotation. #1823

doctrinebot opened this Issue · 3 comments

2 participants


Jira issue originally created by user hypno:

So that even associations, find(), findBy() etc will be affected. Very useful for entities that are being used on every request.

Is that thinkable?


Comment created by holtkamp:

During development, I tried to have the out-of-the-box ORM layer handle as much of the queries as possible, essentially I used the Repository functions a lot:

For example, having a specific Repository extend the Doctrine EntityRepository and do something like:

    public function findByName($name)
        $criteria = array('_name' => $name);
        return parent::findBy($criteria);

Now all functionality is developed, I am optimizing performance and I find myself having to refer my Repository to my DAO layer which uses DQL, so I can enable the DQL Result Cache...

    public function findByName($name)
       //Use the DAO so we can enable DQL ResultSet caching
        return $this->_getDao()->loadByName($name);

It would be nice to be able to configure 'DQL Result Cache = on' on Repository level as well...


Comment created by @FabioBatSilva:

Fixed by : b081e56


Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.5 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.