Sample Header Ad - 728x90

What is the difference and relation between the "--default-cache-ttl" and "--max-cache-ttl" options?

0 votes
1 answer
41 views
About GPG is mentioned the gpg-agent and I read the following answer: * [gpg does not ask for password](https://unix.stackexchange.com/a/395876/383045) Where is mentioned the --default-cache-ttl and --max-cache-ttl options. So I found this official source: * [man - GPG-AGENT(1)](https://www.gnupg.org/documentation/manuals/gnupg24/gpg-agent.1.html)
--default-cache-ttl n
Set the time a cache entry is valid to n seconds. The default is 600 seconds.
Each time a cache entry is accessed, the entry's timer is reset.
To set an entry's maximum lifetime, use max-cache-ttl
 Note that a cached passphrase may not be evicted immediately from memory if
no client requests a cache operation. This is due to an internal housekeeping
function which is only run every few seconds.

--max-cache-ttl n
Set the maximum time a cache entry is valid to n seconds.
After this time a cache entry will be expired even if it
has been accessed recently or has been set using gpg-preset-passphrase.
The default is 2 hours (7200 seconds).
Therefore consider the **main question** as follows: * What is the difference and relation between the --default-cache-ttl and --max-cache-ttl options? And as secondary questions the following: * What is exactly the cache entry? * What is the criteria of the gpg-agent to know when consider/apply the --default-cache-ttl and --max-cache-ttl options? Therefore I want clearly understand the points/scenarios/criteria about when and why was considered the 600 seconds (10 minutes) and 7200 seconds (2hrs) according with each option
Asked by Manuel Jordan (2108 rep)
Apr 7, 2025, 01:05 AM
Last activity: Apr 7, 2025, 07:09 AM