No matter what I try, I cannot get FFImageLoading disk caching to work in my Xamarin Forms app. I have FadeAnimationEnabled turned on, with a long duration, so that I can easily see when images are cached vs not.
In memory caching is working great, no long fade-in on the second load.
But relaunch the app, and I see the long fade, no caching.
Turn off WiFi, and then no images at all.
I have tried CacheType as both All and Disk
I have CacheDuration set to 30 days
I call both Init() and InitImageSourceHandler() after XF.Init() in AppDelegate (and equivalent on Android)
Images are loaded from remote URL (Google Storage HTTPS)
I use MonkeyCache for other local disk caching with no problems
Configuration:
Both iOS and Android
FFImageLoading 2.4.11
XF 4.7.0
Any input would be much appreciated!
Related
I have an application that calls a webview, this application is made on the Xamarin Android and Xamarin IOS.
In Webview android when I access the page the first time the page takes to load, but in the next request is very fast (even after closing and opening the application again), this is because I programmed for webview to keep the cache.
In the UIWebview (IOS) when I access the page the first time page it takes to load, but in the next request is very fast, however when I close the application and open again the first load is slow (as if when closing the application IOS cleaned the cache).
They would know how to help me keep the cache in UIWebView on xamarin IOS, and even when I close the application I have already made access on the page load quickly (as it works on android).
I'm building a Xamarin app, using ImageSharp for image manipulation.
I've noticed that the ImageSharp operations are very slow in the emulator and ridiculously slow when deployed to a physical device (Galaxy Note 8).
Things that are way slow:
// Load image (very slow)
var image = SixLabors.ImageSharp.Image.Load(stream);
// Manipulate image (equally slow)
image.Mutate(i => i.Resize(new ResizeOptions
{
Mode = ResizeMode.Pad,
Position = AnchorPositionMode.Top,
Size = new SixLabors.Primitives.Size(600,400))
}));
Note that the image loads fine (albeit slowly) and the resizing works, but it's very slow (30-60 seconds).
Executing the same code from a .NET Core console program reduces the load and manipulation times to about 1-2 seconds.
With the debugger attached, I see a flood of these when ImageSharp operations are running:
GC_MINOR: (Nursery full)
I'm not really sure how to troubleshoot this, is my only option to clone the ImageSharp repo and debug using a custom build?
Edit: Not sure if this may be related to this issue?
Edit #2: I gave up on ImageSharp and also tested OpenCV to no particular avail and then settled on SkiaSharp which works great right out of the box.
I'm developing TV app with TOAST and in one of my menu I have a catalog with about 100 images.
If I load images like below does tizen and orsey cache them and use them later or they read those from server every time.
<div style="background-image:url(http://Mydomain/pages/4.jpg)"></div>
I can think about some other solutions like:
Add those images to TV app package (But in that case, the package size would be about 20MB)
Get them with ajax and store them locally and than use them
What is the best solution for this?
I have been working on Smarttv platforms long time. Sadly It seems best way is serve static files with app package.
With 3 levels of abstraction (VS->Mac, Mac->phone/simulator app, app->webview), I'm not sure where to start.
I have cross-plat Xamarin app with nothing more than a webview (in Xamarin.Forms) hosting an external website (I also created). The website & all hosted apps (Windows/Android) perform very well, except on ios-webview. (Safari on ios and phone work fine). However, on ios/hosted-app, a 3 second load takes 60+ seconds.
Hopefully without having to add specific console/debug messages, how do I go about seeing where (in javascript), the time is lost - or what the issue might be?
Thanks,
I've got a simple little web app that's aggregating a couple views from some ethernet enabled cameras around my house. This is basically a little dashboard, so that I can easily tell what's going on around the house. I've got it refreshing the images every so often by appending new Date().getTime() to the base URI.
Everything works happy days, except for one little issue. If I leave the dashboard up on my iPad for awhile, it runs out of memory and crashes back to the home screen. I know that its because Mobile Safari is caching each of these images in RAM and it eventually ends up with far too many of them.
Since these images are being hosted on embedded devices; I really have no ability to modify the caching headers directly. I would like to stay away from making a wrapper on my server side as well.
My question is; can anyone think of a way to prevent Mobile Safari from caching these images so aggressively that it crashes?
You might try to reuse your img tags and/or set the src attribute to an empty string before removing an image. It's probably not an aggressive cache that's crashing mobile safari, but how the browser doesn't deal well with releasing image references when image tags get deleted.
You might find more useful information here:
http://www.vargatron.com/2010/08/ipad-html5-js-memory-management/