-
Notifications
You must be signed in to change notification settings - Fork 45
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
Question about caching #12
Comments
Hello @kiwo12345, thank you for very good questions. 1) Does this lib cache images by default?The answer is not simply yes or no, it is more subtle. By default, moa uses the caching strategy from the HTTP response. If caching is configured on your server then, yes, moa will cache the images accordingly. // Default setting
Moa.settings.cache.requestCachePolicy = .useProtocolCachePolicy 2) Must I change some settings in Moa?If you want to always cache images and ignore their HTTP caching policy, please use the Moa.settings.cache.requestCachePolicy = .returnCacheDataElseLoad 3) This might not belong here but does Moa clear the cache once it get full?Moa uses 4) I am used to Kingfisher where most of the stuff is configured out of the box, cache clear, cache time etcThis is wonderful, Kingfisher is one of the libraries I recommend as a good alternative to moa. 5) Caching manualIf you need more information about caching in moa, please refer to the caching manual. Let me know how it goes. |
@evgenyneu thanks for your answer! And sorry, I had two tabs open and thought I posted my question in the Auk lib. |
No worries, I will leave this issue open. I think it is a very good question and it will be useful to others. |
@evgenyneu +1 for this tip you left in another issue: |
I am glad it was helpful. Let me know if you see any issue, so we can make the library better. |
do I set all this in viewDidLoad? @kiwo12345 @evgenyneu |
@yarodevuci, thanks for the question. The caching settings can be changed at any point in your program, including |
@evgenyneu Thanks for quick response Here is my code:
Console output: [moa] 2017-05-06 07:15:51.210 GET https://** Image never gets loaded..:( |
@yarodevuci, the image download might be cancelled if another download is started. This can happen, for example, if you execute |
Just curious, is it possible for you to use the
If that's possible, that would make the program much simpler. :) |
@evgenyneu
and same result. |
Oh, I probably know what it is :). The |
@evgenyneu yep, that did the trick! Thanks |
Thanks for sharing this lib!
Does this lib cache images by default? Or must I change some settings in Moa?
This might not belong here but does Moa clear the cache once it get full?
I am used to Kingfisher where most of the stuff is configured out of the box, cache clear, cache time etc
The text was updated successfully, but these errors were encountered: