This module provides a wrapper for Cache data structures to add a feature of the cache expiring.
To describe how long should keep an item in the cache, use the ttl parameter.
The value for ttl should be provided in milliseconds.
When you wrap a cache object with the ttl decorator, you can provide the default ttl value.
This value is used when you don't provide the ttl parameter when saving an item.
core/cache/decorators/ttl
This module provides a wrapper for Cache data structures to add a feature of the cache expiring. To describe how long should keep an item in the cache, use the
ttlparameter. The value forttlshould be provided in milliseconds.Example
Default ttl
When you wrap a cache object with the
ttldecorator, you can provide the default ttl value. This value is used when you don't provide thettlparameter when saving an item.Property collisions
In case of a property collision, all old properties, including their TTL values, will be overwritten.