Hi to all!
I've an image in a server, with an unique link. I want to display this image inside an imageview. I download it and after display it, i also save it in cache folder. When i re-enter in the page, if the image is in cache then i display it. Now i want to mantain updated the image, as it sometimes change, but i want avoid to download the image every time i go in the page. Link need to be the same, so i can't change it. How can i setup this case? I saw something like Etag in http, but seems it is not fully supported in OkHttp and Android. I though i can use a php to check the filesize in server and in cache, and download the image only if them are different, but the filesize is not the same (maybe different file size compression in different system?). Any ideas?
PS: i know there are Picasso and Glide, but i need to do a "manual" solution as i need to port it in iOS
Many thanks!
I've an image in a server, with an unique link. I want to display this image inside an imageview. I download it and after display it, i also save it in cache folder. When i re-enter in the page, if the image is in cache then i display it. Now i want to mantain updated the image, as it sometimes change, but i want avoid to download the image every time i go in the page. Link need to be the same, so i can't change it. How can i setup this case? I saw something like Etag in http, but seems it is not fully supported in OkHttp and Android. I though i can use a php to check the filesize in server and in cache, and download the image only if them are different, but the filesize is not the same (maybe different file size compression in different system?). Any ideas?
PS: i know there are Picasso and Glide, but i need to do a "manual" solution as i need to port it in iOS
Many thanks!