[native] cache LoadableImage in memory and disk
Summary:
The disk lookup for avatars with remote URLs causes a flicker. We can cache in memory as well to remove this flicker. We keep the disk cache as a fallback (e.g. for offline mode).
From the expo docs:
Memory cache may be purged very quickly to prevent high memory usage and the risk of out of memory exceptions.
It seems safe to cache in memory, and I feel like we've seen this flicker elsewhere (maybe encrypted images?), so I've changed the cache policy for all LoadableImages, but can narrow the scope to just Avatars if desired.
Test Plan: Confirmed on simulator and physical device that flicker doesn't occur
Reviewers: bartek, ashoat, angelika
Reviewed By: ashoat
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D14443