Comments (3)
Hi @ThomasGrunewald, this is very interesting, thanks for reporting. This project has a demo iOS app that shows the images in the scroll view. On the server I have set the expiration to 30 sec to match yours.
Response for one of the images: http://evgenii.com/files/2015/06/moa_demo/ChirogaleusMiliiSmit.jpg
ETag "5771cabd-4731"
Cache-Control max-age=30
Once all the images are downloaded by the app, it sends all the subsequent requests with the "If-" headers:
I could not reproduce your problem, for me it always sends "If-" headers after the first download for default settings. But then I reduced the sizes of both the memory and disc cache to 512 KB.
// Change memory cache size. Default is 20 MB.
Moa.settings.cache.memoryCapacityBytes = 512 * 1024
// Change disk cache size. Default is 100 MB.
Moa.settings.cache.diskCapacityBytes = 512 * 1024
Now it started sending the requests without the "If-"headers. I guess this is happening because the cache size is not enough to keep all the images in it.
If your images are large and/or there are a lot of them that default cache may not be large enough to store all the images. This is just a hypothesis. What do you think?
I was using Xcode 8, iOS 10 simulator and Charles proxy. I will keep my server running with 30 sec cache expiration for now so we can debug the problem.
from moa.
Thanks for your quick reply @evgenyneu . I forgot to tell you about my testing environment. I am using Xcode 7.3.1/ iOS 9 Simulator / swift 2.2 and Charles proxy
.
If I am putting my image url´s into your demo app everything work as expected. Seems like different caching (eatg) behavior between the iOS versions. ?
from moa.
That may be the case. I just tested the Swift 2.2 version of Moa in iOS 9 Simulator and Xcode 7. I could not reproduce your issue. It always sent subsequent requests with "If-" headers for me.
Here is how to jump back to the Swift 2.2 version:
git checkout tags/3.0.0
Maybe there are differences between our server responses as well. If you are willing to share your image URLs I would test them in the Swift 2.2 version of the demo and see if I can catch the problem.
from moa.
Related Issues (19)
- Some error after update to last version 5.0.0 HOT 5
- ** BUILD FAILED ** with Carthage, Xcode 7.3.1 HOT 3
- Question about caching HOT 13
- tvOS and LCR images HOT 3
- Image never loads
- determining if image was loaded from cache HOT 5
- Image flicker when table view reload called HOT 3
- moa.MoaError.notAnImageContentTypeInResponseHttpHeader HOT 8
- cannot shown image from links HOT 5
- Unable to have simultaneous downloads/load from cache HOT 2
- Adding Custom Headers to download request (Bearer {{access_token}}) for example HOT 1
- Request to bump iOS deployment target for Xcode 14.X build HOT 1
- Failure when downloading .gif in 3.0 HOT 3
- Placeholder image in moa? HOT 2
- What cache policy is the best for this situation ? HOT 2
- Animate Image after downloading HOT 1
- I still use the Swift2.2 HOT 1
- [QUESTION] Manually invalidating cache HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moa.