Class FeatureRefreshCacheFreshness

java.lang.Object
growthbook.sdk.java.featurefetch.FeatureRefreshCacheFreshness

public final class FeatureRefreshCacheFreshness extends Object
Decides whether a non-forced feature refresh can skip the network request because cached or in-memory feature data is still fresh enough.
  • Method Details

    • shouldSkipRefresh

      public static boolean shouldSkipRefresh(boolean forceRefresh, Duration backgroundFetchInterval, LongSupplier lastSuccessfulFetchAtMillis, LongSupplier cacheLastUpdatedMillis, BooleanSupplier hasFeatureData, BooleanSupplier loadCachedFeatures)
    • timestampMillisOrUnknown

      public static long timestampMillisOrUnknown(Long timestampMillis)
      Converts nullable cache timestamps into the primitive form used by the freshness check.