Package com.inmobi.ads.cache
Object WebAssetLRUCacheHelper.Companion
-
- All Implemented Interfaces:
public class WebAssetLRUCacheHelper.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static WebAssetLRUCacheHelper.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final IntegergetOptimalDiskLRUCacheSize(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. -
-
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.
-
-
-
-