Closed enginebai closed 7 years ago
I fixed the problem by providing signature(new StringSignature(String.valueOf(System.currentTimeMillis() / (1000 * 60 * 10))))
.
Sorry for the silence, yes, Glide doesn't support it out of the box.
You can get OkHttp to do the caching and invalidation based on headers for you, but then you have to disable Glide cache (.diskCacheStrategy(NONE)
).
OK, thanks for your kindly help.
Will volley work also? I am currently using volley and I don't want to add okhttp.
@platinum7919 sure, if you know how to configure it to handle these headers. It doesn't matter what you use as long as you can configure it correctly.
Is this still the case with Glide 4.7? Are there any disadvantages to disabling disk cache and using OkHttp cache instead? Our typical use case is avatar images being cached indefinitely. The way we've solved this so far is by invalidating using .signature(ObjectKey)
. But that invalidates mostly valid caches. Thank you for a wonderful library!
I fixed the problem by providing
signature(new StringSignature(String.valueOf(System.currentTimeMillis() / (1000 * 60 * 10))))
.
Hi, Thanks for the solution. In My case I need to set the cache for 3,628,800 seconds. May I know how can I set the calculation for this? Thanks
@kavinmk6 The example is 10 minutes (600 seconds).
Hi, my app provides user to upload avatar, and server side use
cache-control: max-age=600, public
to control cache.My problem is that after uploading the image, the glide still load the cached image, and I use browser to open the image, it's updated. Does glide support
cache-control
header? Or how can I control cache in this way?Here is my code to load image, I use
signature()
api but doesn't work.