Fix cache

This is a new version of the cache.

 - First commit show the old one generate exception or deadlock.
 - Second commit contain the new cache that use ReaderWriterLockSlim