Fixes concurrency issue with the cache
Merge pull request #1010 from emmanuel-keller/1.5

Fixes concurrency issue with the cache