@Override
    public void setMaxLifetime( final long maxLifetime )
    {
        cache.policy().expireAfterWrite().ifPresent( expiration -> expiration.setExpiresAfter( Duration.ofMillis( maxLifetime ) ) );;
    }
Sets the maximum number of milliseconds that any object can live
in cache. Once the specified number of milliseconds passes, the object
will be automatically expired from cache. If the max lifetime is set
to -1, then objects never expire.

<p><strong>Note:</strong> If using the Hazelcast clustering plugin, this will not take
effect until the next time the cache is created</p>

@param maxLifetime the maximum number of milliseconds before objects are expired.
xmppserver/src/main/java/org/jivesoftware/util/cache/CaffeineCache.java