very preliminar implementation of cache into sqlite database; not linted