generic cache framework