androidx / androidx/media

Use a in memory cache instead of file storage

Open
#2,604 1 comment 0 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since Jul 14, 2025.

enhancement
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

[REQUIRED] Use case description

I often use caching of manifests and segments for content, now there is a single Cache implementation -> SimpleCache, which works with file storage, and there is a need to solve the following problems:

  1. I want to write less to disk so as not to consume device resources;
  2. On some TV devices, read/write operations take a long time;
  3. Users have errors related to reading/writing to the file system (they cannot create a directory or file; there is not enough space on the device).

Therefore, there is a desire to try using temporary RAM instead of the file system for sometimes, and of couse it's will work only for an active sessions. Also, this type of cache will most likely need to be used with lower maximum MB storage values.

Proposed solution

Maybe, create a implementation of the androidx.media3.datasource.cache.Cache interface that will work with RAM instead of the file system, named InMemoryCache for example.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.