By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: How Grab Optimizes Image Caching on Android with Time-Aware LRU
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > News > How Grab Optimizes Image Caching on Android with Time-Aware LRU
News

How Grab Optimizes Image Caching on Android with Time-Aware LRU

News Room
Last updated: 2026/03/14 at 4:40 PM
News Room Published 14 March 2026
Share
How Grab Optimizes Image Caching on Android with Time-Aware LRU
SHARE

To improve image cache management in their Android app, Grab engineers transitioned from a Least Recently Used (LRU) cache to a Time-Aware Least Recently Used (TLRU) cache, enabling them to reclaim storage more effectively without degrading user experience or increasing server costs.

The Grab Android app used Glide as its primary image loading framework, including an LRU cache to store images locally in order to reduce network calls, improve load times, and lower server costs. However, analytics showed that using a 100 MB LRU cache had significant shortcomings: it often filled up quickly for many users, leading to performance degradation, while in other cases images remained cached for months if the cache never exceeded the size limit, thus wasting storage.

To circumvent these limitations, they decided to extend LRU with time-based expiration. TLRU uses three parameters, Time To Live (TTL), which determines when a cache entry is considered expired; a minimum cache size threshold, which ensures essential images remain cached even when they expire if the cache is underpopulated; and maximum cache size, which enforces the upper storage limit.

Instead of implementing TLRU from scratch, Grab engineers chose to fork Glide and extend its DiskLruCache implementation, leveraging its “mature, battle-tested foundation”

This implementation is widely adopted across the Android ecosystem and handles complex edge cases like crash recovery, thread safety, and performance optimization that would require substantial effort to replicate.

DiskLruCache needed to be extended along three dimensions by adding support for tracking last-access time, implementing time-based eviction logic, and including a migration mechanism for existing user caches.

Last-access times were required to sort cache entries by their most recent access and had to be persisted across app restarts. The time-based eviction logic ran on each cache access to check if the least recently accessed entry has expired before removing it. For existing cache migration, the main challenge was assigning last-access timestamps to LRU entries. Since filesystem APIs did not provide a reliable source, Grab engineers decided to assign the migration timestamp to all entries:

This approach preserves all cached content and establishes a consistent baseline, although it necessitates waiting one TTL period to realize the full benefits of eviction. We also ensured bidirectional compatibility – the original LRU implementation can read TLRU journal files by ignoring timestamp suffixes, enabling safe rollbacks if needed.

Another challenge was finding optimal configuration values, which was based on controlled experiments.

Our success criteria is for a cache hit ratio decrease of no more than 3 percentage points (pp) during the transition to TLRU. For instance, a decrease from 59% to 56% hit ratio would result in 7% increase in server requests. This threshold balances storage optimization with acceptable performance impact.

Using this approach, 95% of the app users saw a 50MB reduction in cache size, with the top 5% seeing even larger savings. Based on these results, Grab engineers estimated that they could reclaim terabytes of storage across devices while maintaining the cache hit ratio within acceptable limits and without increasing server costs.

The original post provides highly valuable detail on LRU behavior and TLRU implementation than can be covered here. Make sure you read it to get the full detail.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Before you catch ‘Project Hail Mary’ in theaters, you need to stream these 3 sci-fi movies on Netflix Before you catch ‘Project Hail Mary’ in theaters, you need to stream these 3 sci-fi movies on Netflix
Next Article You can get a year of Google Fi for half off right now, with prices as low as .50 a month You can get a year of Google Fi for half off right now, with prices as low as $11.50 a month
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Don’t Try To Charge A Power Bank While Using It, Unless It Has This Feature – BGR
Don’t Try To Charge A Power Bank While Using It, Unless It Has This Feature – BGR
News
10 Benefits of Using a Voice AI Agent Across Your Sales Funnel
10 Benefits of Using a Voice AI Agent Across Your Sales Funnel
Gadget
Cambium Networks expands its range of enterprise firewalls with Network Service Edge NSE?4000
Cambium Networks expands its range of enterprise firewalls with Network Service Edge NSE?4000
Mobile
One UI 8.5 makes routines more flexible with new scheduling options
One UI 8.5 makes routines more flexible with new scheduling options
News

You Might also Like

Don’t Try To Charge A Power Bank While Using It, Unless It Has This Feature – BGR
News

Don’t Try To Charge A Power Bank While Using It, Unless It Has This Feature – BGR

3 Min Read
One UI 8.5 makes routines more flexible with new scheduling options
News

One UI 8.5 makes routines more flexible with new scheduling options

2 Min Read
Today's NYT Connections Hints, Answers for March 15 #1008
News

Today's NYT Connections Hints, Answers for March 15 #1008

3 Min Read
Invisible datacentres and capricious chips: is UK’s AI bubble about to burst?
News

Invisible datacentres and capricious chips: is UK’s AI bubble about to burst?

12 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?