Adding support to count local and cached data