# Reclaiming Terabytes: Optimizing Android image caching with TLRU

[Grab](https://yomu.fyi/company/grab) · Nguyen Van Minh · Mar 6, 2026

## Summary

The Grab Android application relies heavily on dynamically downloaded images managed through Glide's disk cache, which originally enforced a 100 MB limit without evaluating content age. While the 90th percentile of users consistently hit this maximum capacity, users below the threshold retained stale promotional and feature assets indefinitely. To reclaim storage while protecting user experience, engineers extended Glide's existing DiskLruCache implementation into a Time-Aware Least Recently Used (TLRU) cache. The TLRU design pairs standard maximum size limits with Time-To-Live eviction based on last-accessed timestamps, alongside a minimum size safety threshold that preserves essential files for returning users. This hybrid approach enables proactive eviction of outdated content without causing empty-cache performance penalties or increasing backend requests.

## Takeaways

- Standard disk LRU caching only evicts items when the storage limit is breached, allowing outdated images to persist indefinitely on devices below the capacity cap.
- The TLRU cache introduces a Time-To-Live threshold that marks an entry as expired whenever (current\_time - last\_accessed) exceeds the TTL value.
- A minimum cache size threshold acts as a safety floor, preventing the eviction of expired assets if the overall cache size would fall below that baseline.

**Tags:** [Android](https://yomu.fyi/topic/android), [Caching](https://yomu.fyi/topic/caching), [Performance](https://yomu.fyi/topic/performance)

[Read original post](https://engineering.grab.com/reclaiming-tetabytes-optimizing-android-image-caching-with-tlru)
