Kdyby / DoctrineCache

Doctrine 2 Cache integration into Nette Framework
https://packagist.org/packages/kdyby/doctrine-cache
Other
10 stars 21 forks source link

Cannot cache an empty array #12

Closed Andrewsville closed 8 years ago

Andrewsville commented 8 years ago

We have encountered this issue when using Doctrine annotation reader. When its result is an empty array, it tries to re-read annotations for the particular file on every request because of this ternary that makes DoctrineCache behave like there was no value cached.

enumag commented 8 years ago

Yeah, the code should look like this instead.

$data = $this->cache->load($id);
return $data !== NULL ? $data : FALSE;

Can you send a pull request?

enumag commented 8 years ago

By the way I believe this is what was causing some of my performance problems before I stopped using this class. Thanks for finding the reason!

enumag commented 8 years ago

Closed by https://github.com/Kdyby/DoctrineCache/commit/93fd43c9d972bd59b42f4499ae9bc94cdb554e99