Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glide should not generically cache Uris #174

Closed
sjudd opened this issue Oct 4, 2014 · 0 comments
Closed

Glide should not generically cache Uris #174

sjudd opened this issue Oct 4, 2014 · 0 comments
Labels

Comments

@sjudd
Copy link
Collaborator

sjudd commented Oct 4, 2014

Although it's unfortunate, content at uris can change without the uri changing so we can't reliably invalidate cache files. We can get around this for media store uris only by requiring users to pass in additional data from the media store (see http://bumptech.github.io/glide/javadocs/latest/com/bumptech/glide/RequestManager.html#loadFromMediaStore(android.net.Uri, java.lang.String, long, int)). This data must be available at the time the request is made so that we can construct the key for the memory cache synchronously.

To fix this, we should:

  1. Default to DiskCacheStrategy.NONE for Uris (other than http/https).
  2. Default to not caching loads for Uris in the memory cache.
  3. Provide a nicer api for loading a Uri with some kind of cache buster string that can be mixed into the cache key for those who want to take on the responsibility of handling cache invalidation themselves.

See #172 for an example of where our current behavior can cause problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant