updated lru cache so easier to integrate
Fixes #4978 integrates LRU cache for db query cache