move clear cache to db layer