Skip to content

v1.8

Latest

Choose a tag to compare

@solkin solkin released this 19 Jan 00:46

What's New in v1.8

πŸš€ New Features

Records Info API

  • New getRecordsInfo() method returns all cached records sorted by LRU order
  • New getRecordInfo(key) method retrieves record metadata without updating access time
  • New RecordInfo class exposes key, filename, size, and last access timestamp
  • Perfect for cache monitoring, debugging, and building cache management UIs
List<RecordInfo> records = cache.getRecordsInfo();
// Records at the end will be evicted first

πŸ› Bug Fixes

  • Fixed file leak on key overwrite β€” Previously, replacing a file with a different extension would leave orphaned files on disk
  • Fixed accept() logic β€” Resolved incorrect boolean operator usage that could silently fail file operations
  • Added cross-filesystem fallback β€” renameTo() failures now gracefully fall back to copy+delete

✨ Improvements

  • RecordNotFoundException now properly extends Exception instead of Throwable
  • Added file size validation β€” files larger than cache size are rejected with clear IOException
  • Added parameter validation in create() with descriptive error messages
  • Replaced deprecated Charset.forName() with StandardCharsets.UTF_8
  • Fixed potential NPE in SimpleLogger constructor

πŸ“± Demo App

Completely rewritten with modern Android stack:

  • Kotlin β€” 100% Kotlin codebase
  • Jetpack Compose β€” Declarative UI with Material 3
  • Clean Architecture β€” Domain, Data, and Presentation layers
  • MVVM β€” ViewModel + StateFlow
  • Coroutines β€” Async operations
  • Swipe-to-delete, bottom sheets, dynamic theming

πŸ“– Documentation

  • Added Thread Safety section
  • Added Limitations section
  • Added Requirements (Min SDK 16, Target SDK 35)
  • Added Custom FileManager/Logger examples
  • Documented new Records Info API

πŸ§ͺ Testing

  • Added comprehensive DiskLruCacheUnitTest (24 tests)
  • Added SimpleFileManagerUnitTest (12 tests)
  • Test coverage for LRU eviction, file operations, edge cases

πŸ‘¨β€πŸ’» New Contributors

  • @khoben made their first contribution: fix .aar build in #7

Full Changelog: v1.7...v1.8