HomePhabricator
Diffusion Comm ed60c0d6b05d

[native][lib] Introduce media cache context

Description

[native][lib] Introduce media cache context

Summary:
This diff introduces a new react context that addresses encrypted media caching. The cache has two layers:

  • in-memory for quickly mapping holder -> URI to cached resource. We cannot fully rely on it so it also reaches the underlying layer each time, but this operation is fast and avoids more costly operations.
  • persistent, based on filesystem, implemented in subsequent diff.

The cache automatically maintains its size and keeps it below the limit. I set it to 100MB but it can be adjusted if needed.

Public interface exposes only two methods: get and set.

Test Plan: This is tested together with subsequent diffs

Reviewers: ashoat, atul, tomek, marcin

Reviewed By: ashoat

Differential Revision: https://phab.comm.dev/D7251

Details

Provenance
bartekAuthored on Mar 30 2023, 6:44 AM
Reviewer
ashoat
Differential Revision
D7251: [native][lib] Introduce media cache context
Parents
rCOMM49c2a6e22823: [web-db] extract worker write requests to a separate condition
Branches
Unknown
Tags
Unknown