implements caching of DB files