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
This PR is an attempt to improve image caching. This has been a long-running discussion (see a few of the linked PRs below).
The most recent solution was to cache images with a timeout. This means that scrolling through the feed is nice, but navigating into a post for a while and then navigating back can still cause all the images to reload. In fact, this behavior recently prompted a new issue, #1101.
Since it seems that there's no perfect solution which will both keep images cached and improve performance while also maintaining a low memory profile, I've added a new advanced setting which lets the user pick their preferred behavior.
The new default behavior will be like prior to #745, meaning that images may reload as you scroll up and down the feed, but should not reload when navigating back from a post (
clearMemoryCacheWhenDispose
istrue
).The new optional behavior is to have more aggressive caching than even in #745, more like after #463, where
clearMemoryCacheWhenDispose
isfalse
andcacheMaxAge
is not set.Important
The important thing is that neither mode should cause the flashing described in #1101, because that was purely due to the
cacheMaxAge
. It was forcibly invalidating cache, even before the widget was disposed.Issue Being Fixed
Issue Number: #1101
Screenshots / Recordings
qemu-system-x86_64_7XJ47ndbLU.mp4
Checklist
semanticLabel
s where applicable for accessibility?