new caching system using SQLite