@Override
    public long expireAfterCreate(final String key, final Ticket ticket,
                                  final long currentTime) {
        if (ticket.isExpired()) {
            LOGGER.trace("Ticket [{}] has expired and shall be evicted from the cache", ticket.getId());
            return 0;
        }
        return Duration.ofSeconds(RedisKeyGenerator.getTicketExpirationInSeconds(ticket)).toNanos();
    }
This is {@link CachedTicketExpirationPolicy}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-redis-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/CachedTicketExpirationPolicy.java