dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.04k stars 1.73k forks source link

Image caching #22418

Open slouge opened 4 months ago

slouge commented 4 months ago

Description

Based on official Image .Net MAUI documentation here caching feature is available by design using CacheValidity

`

` But today trying to understand why caching doesn't work on my application, i was checking the source code of [UriImageSource.cs](https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/UriImageSource.cs) `async Task GetStreamAsync(Uri uri, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); Stream stream = null; if (CachingEnabled) { // TODO: CACHING https://github.com/dotnet/runtime/issues/52332 // var key = GetKey(); // var cached = TryGetFromCache(key, out stream) if (stream is null) stream = await DownloadStreamAsync(uri, cancellationToken).ConfigureAwait(false); // if (!cached) // Cache(key, stream) } else { stream = await DownloadStreamAsync(uri, cancellationToken).ConfigureAwait(false); } return stream; }` I was a little bit surprised to see thath caching is commented, i'm missing something ? ### Steps to Reproduce _No response_ ### Link to public reproduction project repository _No response_ ### Version with bug 8.0.40 SR5 ### Is this a regression from previous behavior? Yes, this used to work in Xamarin.Forms ### Last version that worked well Unknown/Other ### Affected platforms Android ### Affected platform versions _No response_ ### Did you find any workaround? No ### Relevant log output _No response_
github-actions[bot] commented 4 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

QianaJiao commented 3 months ago

This issue still exists, and it is the similar issue as https://github.com/dotnet/maui/issues/9138