Update CacheService.php

Updated shouldCacheRequest to account for object type prior to calling a function on it.