fedora-infra / mobile

An Android app that allows the Fedora community to interact with Fedora's web apps on the go.
https://fedoraproject.org/mobile
Other
27 stars 10 forks source link

Better handling of cache #7

Closed relrod closed 10 years ago

relrod commented 11 years ago

There's a few issues here:

To work around this, I think we could make a table in the sqlite database and store last_miss_timestamp and last_hit_timestamp - the miss timestamp gets updated when when we cache an image from HTTP. The hit timestamp gets updated when we pull an image from cache.

When we want to check for new versions of images (we'll do this and just consider it a miss if it's too old), we'll check cache_miss_timestamp. When we want to check if we should delete an image we haven't used in a long time, we can check the cache_hit_timestamp.

We can clean old cache images that haven't been used in a long time whenever we want (on app startup, e.g.).

We can update the hit timestamp and check the miss timestamp each time we load an image. If the miss timestamp is old, mark it as a miss and repull it.

relrod commented 11 years ago

A lot of this is fixed. We should still monitor the size of our cache, but we do check for new versions of images now.