cacheImagePath method
Cache the image path immediately (fast, no file I/O).
Implementation
String? cacheImagePath({
required int id,
required String type,
String mediaType = 'image/png',
}) {
if (type != 'image') return null;
final imagePath = _getImagePath(id, mediaType);
_evictOldestIfAtCap();
_storedImagePaths[id] = imagePath;
return imagePath;
}