-
Couldn't load subscription status.
- Fork 0
Open
Labels
Description
Context
- Images that are downloaded once, shouldn't need to be requested again
- The cache must obey to cache policies sent by the remote server (read https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching)
Specs
- Can hold up 10k elements (on disk)
- when the 10001 element wants to be cached, the image that was used the least should be uncached (aka if 9999 were requested twice and 1 image was requested once, the latter should be uncached). If two (or more) elements have the same lowest count, uncache any of them.
- public interface should be :
interface MySuperCache {
void get(String imageUrlString, CacheCallback completionBlock);
}
interface CacheCallback {
void onImageRetrieved(Bitmap image);
}
- Class(es) should be testable and tested
- Don't use
HttpResponseCacheorLruCache - Don't use external frameworks (we know they exist)
- Should be reusable (this is why the interface is generic)