get from cache only if necessary