Corrected the getByName method

Ensured that the settings cache was checked first if the cacheSetting
boolean property is turned on.