Improve efficiency of access to cache by using try with instead of systematically test.