nostra13 / Android-Universal-Image-Loader

Powerful and flexible library for loading, caching and displaying images on Android.
Apache License 2.0
16.79k stars 6.1k forks source link

Mechanism eTag with Universal Image Loader #668

Open moisesvs opened 10 years ago

moisesvs commented 10 years ago

Hello,

I'm trying to do a system eTag with the library but do not get I want that when the user login ALWAYS pictures are request and if the server replying to a 304 (Not Modified) take pictures of the cache. I have a customize BaseImageDownloader to download the images and return to the library and do the mechanism of the eTag.

Before of login user I do clearMemoryCache() to force the call to getStream() but y problem is that the library does not call getStream always and I can not check the HTTP cache, how can I do what I'm commenting?

Thanks!

nostra13 commented 10 years ago

If you clear memory cache then ImageDownloader.getStream(...) should be always called (caching on disk should be enabled.

moisesvs commented 10 years ago

Thanks Nostra but this does not work for me Etag mechanism that is called long getStreamFromFile should call getStreamFromNetwork without deleting it from disk. Is this possible?

nostra13 commented 10 years ago

I can't understrand what you just wrote.

moisesvs commented 10 years ago

I said that your code doen´t work because if i clear the memory call to ImageDownloader.getStream(...) but don't only when i clear the memory also when retrieve a image and this doen't in memory. I need that only call getStream one time to retrieve the eTag from server and check. you understand me?