The calls to cache.set happen only in the "happy path" when we've successfully verified a token. If we fail to verify a token for any reason, we usually throw an exception, which passes outside this control flow path. Some types of exception are probably indicative of a transient failure that we should retry, like a network failure, but other types represent rejected tokens (like this OutOfProtocolError), and those responses should maybe be cached too to minimize network traffic in the future.
The calls to cache.set happen only in the "happy path" when we've successfully verified a token. If we fail to verify a token for any reason, we usually throw an exception, which passes outside this control flow path. Some types of exception are probably indicative of a transient failure that we should retry, like a network failure, but other types represent rejected tokens (like this OutOfProtocolError), and those responses should maybe be cached too to minimize network traffic in the future.