Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created January 4, 2026 08:57
Show Gist options
  • Select an option

  • Save skydoves/4a8962da2b5001042190dc5c0ec267e4 to your computer and use it in GitHub Desktop.

Select an option

Save skydoves/4a8962da2b5001042190dc5c0ec267e4 to your computer and use it in GitHub Desktop.
Landscapist: Cache Policies
val request = ImageRequest.builder()
.model(imageUrl)
.memoryCachePolicy(CachePolicy.ENABLED) // Read and write
.diskCachePolicy(CachePolicy.READ_ONLY) // Only read, never write
.build()
// Available policies:
// CachePolicy.ENABLED - Read and write (default)
// CachePolicy.READ_ONLY - Only read from cache
// CachePolicy.WRITE_ONLY - Only write to cache
// CachePolicy.DISABLED - Bypass cache completely
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment