# ttl

Tag: ttl
Since 2.0 Defines a TTL (Time To Live) rule for resolved revision caching. When Ivy resolves a dynamic version constraint (like latest.integration or a version range), it can store the result of the resolution (like latest.integration=1.5.1) for a given time, called TTL. It means that Ivy will reuse this dynamic revision resolution result without accessing the repositories for the duration of the TTL, unless running resolve in refresh mode.
This tag let you define a rule to define a TTL specific to a set of dynamic revision, based on the whole module revision information (organization, module name, revision, ...). The revision considered in the rule is the revision before the resolution (for instance 'latest.integration') and not the resolved revision (for instance '1.5.1').
The rules are evaluated in order, the first matching rule being used to define the TTL. If no rule matches, the cache defaultTTL will be used.
The format used to specify the TTL is of the form:

    XXd XXh XXm XXs XXXms

Where 'd' stands for days, 'h' for hours, 'm' for minutes, 's' for seconds and 'ms' for milliseconds. Any part of the specification can be omitted, so '12d', '2h 5m' and '1d 5ms' are all valid.
The TTL duration can also be set to 'eternal', in which case once resolved the revision is always use, except when resolving in refresh mode.
Using a 0ms TTL disable resolved revision caching for the given rule.

# Attributes

Attribute | Description | Required
--- | --- | ---
organisation | the organisation to match to apply the rule. | No, defaults to *
module | the module's name to match to apply the rule. | No, defaults to *
revision | the module's revision to match to apply the rule. Note that the version is not resolved when evaluating the rule ('latest.integration' for instance). | No, defaults to *
any extra attribute | an extra attribute to match to apply the rule. | No, defaults to *
matcher | the matcher to use to match the modules to which the resolver should be applied | No, defaults to exact
duration | the TTL to apply (see above for format) | Yes