datasource cache logic