Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
PR #463 introduced caching for
ExtendedImage
. PR #576 reverted that change. While we have done several things to reduce the jankiness of reloading images (e.g., removing Hero, removing spinners, calculating height), there are still some times when the image reloads unexpectedly and it can be a bit jarring/annoying. One such example is when marking a post as unread, of all things. There's also still the "issue" where if you scroll out of frame and scroll back, all the images have to reload again (discussed here). Finally, there is some discussion in #487 that caching may help to prevent that issue as well.In this PR, I have first of all set
clearMemoryCacheWhenDispose
back tofalse
. But more importantly, I have also setcacheMaxAge
to 1 minute. This should give us enough time that common operations (scrolling up/down, marking unread) will show the cached image, but the cache will also expire relatively quickly so that prolonged usages of the app will not maintain more than a minute's worth of image cache. (And of course, we can discuss this value.)Let me know your thoughts on this approach! And maybe we can do some profiling too.
Issue Being Fixed
Issue Number: N/A
Screenshots / Recordings
Before
qemu-system-x86_64_G4DuwK9joB.mp4
After
qemu-system-x86_64_XuEKvBe4be.mp4
Checklist
semanticLabel
s where applicable for accessibility?