discord-php / DiscordPHP

An API to interact with the popular messaging app Discord
MIT License
985 stars 236 forks source link

Add CacheConfig::$ttl #1024

Closed SQKo closed 1 year ago

SQKo commented 1 year ago

Useful to set default expiry of cache items if supported by the interface. Ofcourse extreme care needed as it can invalidate cached item at the wrong point where the data is still needed.

BC: a $ttl = null value when manually used in $cache->set(..., null) will be overriden by the provided CacheConfig::$ttl. It can be worked around by temporary switching the CacheConfig::$ttl to null.