Created
January 4, 2026 08:57
-
-
Save skydoves/4a8962da2b5001042190dc5c0ec267e4 to your computer and use it in GitHub Desktop.
Landscapist: Cache Policies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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