Updated script to only refresh the cache if it has expired (don't check for successfulCache val of 'no')