evictCacheFiles
Evicts cached files matching prefix based on a time-to-live and a total size cap.
Deletes every file whose
lastModifiedis older than ttlMs milliseconds.If the remaining files exceed maxSizeBytes in total, deletes the oldest files first until the total drops below the cap.
Parameters
context
Android context for cache directory access
prefix
Filename prefix that identifies files subject to eviction
ttlMs
Maximum age in milliseconds; older files are always deleted
maxSizeBytes
Soft size cap in bytes; exceeded only temporarily until the next eviction pass