static <K, V> ClickHouseCache<K, V> create(int capacity, long expireSeconds, Function<K, V> loadFunc) {
        ClickHouseCache<K, V> cache;

        try {
            cache = CaffeineCache.create(capacity, expireSeconds, loadFunc);
        } catch (Throwable e) {
            // ignore
            cache = JdkLruCache.create(capacity, loadFunc);
        }
        return cache;
    }
Creates a cache with specific capacity and load function.

@param <K>           type of key
@param <V>           type of value
@param capacity      capacity of the cache, zero or negative number will be
                     treated as {@link #DEFAULT_CACHE_SIZE}
@param expireSeconds seconds to expire after access
@param loadFunc      non-null load function
@return cache
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseCache.java