-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
extended cache ability #432
Conversation
If you wrap your code in ``` you'll get much easier to read code in this comment ^ |
@KatekovAnton could you please rebase this on top of master so it can be merged? Also, please explain the capabilities you are trying to add and what problems will those address. |
Hello. Main goal is to cache images using e-tag parameter. SDWebImageManagerCacheDelegate allows you to write your implementation of storing e-tag for cached images. Also it should allows you to make a decision of caching using e-tag for each image individually. For example my client application have images: All I know about avatars - is that application should allways check actual version of this kind of image and, if the new one has been spotted, I should remove old one and download a new one. shouldTrackUpdationForUrl will check url, for example if([url rangeOfString:@"avatars/"].range != 0){return YES;} ->should allways track So, if image should be checked by e-tag, SDWebImageManager runs HEAD request to obtain actual e-tag. If it is same - returns image from cache, if not - download new one. If you think that this functionality is good, i will find time to rebase on top of master. Sincerely yours, |
This PR is about using ETag to identify the same resource. However, this can be done using
So, actually, if you want to request to the server to response the HTTP standard cache control, you can enable that option now. Maybe this option is not availble in the time you create this PR...(4 yeas later 😅) But now it should works. If you want to implement more complicated feature beyond the HTTP standard, welcome to try #2278 feature in 5.x. It allow you to specify custom cache which used by our framework. Thanks for your contribution. So I just close now. ;) |
Hello. Thank you for the feedback. You know I remember time when I created it and I think I was a different person lol, so long time ago! |
comare checksum of cached image to actual, and reload image if needed. I think is very useful ability! Please let me know if you will merge my changes to original project. Thanks in advance.