When I run tor.exe and try to make a connection to a .onion domain via SOCKS and the hidden service is available at that moment, the connection opens quickly. Conversely, if the hidden service is not available, the connection fails after a while. Now let's say that the hidden service turns back online after one minute; it takes my tor instance about 5 minutes to successfully connect to the hidden service, like it was caching the (bad) descriptor of the onion domain. Is there a way to tell tor.exe that this time window should be lower?
You probably don't want to do this, for performance reasons and potentially for anonymity reasons.
Tor does cache rendezvous descriptors. The simplest way to clear this cache is to use the 'New Identity' option on Tor Browser which, amongst other things, sends a
NEWNYM signal to the Tor process over the control port.
Part of the process that Tor performs on receipt of the
NEWNYM signal, is that it clears out the rendezvous descriptor caches. Shortening the time that descriptors are held will only result in degraded performance and potentially could make your Tor usage look different from other Tor users.
If you know the .onion has republished a new descriptor, or suspect it might have then send a
NEWNYM signal and try to contact the .onion service again.