Making caching more consistent across debug and release mode