Better size estimation for cache
Improved database cache test coverage