moved cache codes to sqlite db