Object WebAssetLRUCacheHelper.Companion

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer getOptimalDiskLRUCacheSize(AdConfig.WebAssetCacheConfig webAssetCacheConfig, Long availableDiskSpace) Computes the optimal size for a disk LRU (Least Recently Used) cache based on the provided configuration and the available disk space.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getOptimalDiskLRUCacheSize

         final Integer getOptimalDiskLRUCacheSize(AdConfig.WebAssetCacheConfig webAssetCacheConfig, Long availableDiskSpace)

        Computes the optimal size for a disk LRU (Least Recently Used) cache based on the provided configuration and the available disk space.

        Parameters:
        webAssetCacheConfig - The configuration for the web asset cache, which includes the maximum cache size and the maximum percentage of available disk space that can be used for caching.
        availableDiskSpace - The amount of available disk space in bytes.
        Returns:

        The optimal cache size in bytes. If the available disk space is -1L, it returns 0. Otherwise, it returns the smaller value between the configured cache size and the calculated maximum cache size based on the available disk space.