Correctly detect cache to use