Unverified Commit 160d92e3 authored by liyuqian's avatar liyuqian Committed by GitHub

Increase image cache to 100MB (#19220)

This should fix #18952 and #813
parent 59d6527f
...@@ -5,18 +5,18 @@ ...@@ -5,18 +5,18 @@
import 'image_stream.dart'; import 'image_stream.dart';
const int _kDefaultSize = 1000; const int _kDefaultSize = 1000;
const int _kDefaultSizeBytes = 10485760; // 10 MiB const int _kDefaultSizeBytes = 100 << 20; // 100 MiB
/// Class for the [imageCache] object. /// Class for the [imageCache] object.
/// ///
/// Implements a least-recently-used cache of up to 1000 images. The maximum /// Implements a least-recently-used cache of up to 1000 images, and up to 100
/// size can be adjusted using [maximumSize]. Images that are actively in use /// MB. The maximum size can be adjusted using [maximumSize] and
/// (i.e. to which the application is holding references, either via /// [maximumSizeBytes]. Images that are actively in use (i.e. to which the
/// [ImageStream] objects, [ImageStreamCompleter] objects, [ImageInfo] objects, /// application is holding references, either via [ImageStream] objects,
/// or raw [dart:ui.Image] objects) may get evicted from the cache (and thus /// [ImageStreamCompleter] objects, [ImageInfo] objects, or raw [dart:ui.Image]
/// need to be refetched from the network if they are referenced in the /// objects) may get evicted from the cache (and thus need to be refetched from
/// [putIfAbsent] method), but the raw bits are kept in memory for as long as /// the network if they are referenced in the [putIfAbsent] method), but the raw
/// the application is using them. /// bits are kept in memory for as long as the application is using them.
/// ///
/// The [putIfAbsent] method is the main entry-point to the cache API. It /// The [putIfAbsent] method is the main entry-point to the cache API. It
/// returns the previously cached [ImageStreamCompleter] for the given key, if /// returns the previously cached [ImageStreamCompleter] for the given key, if
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment