Implemented sqlite3 cache database

hope this works...