Skip to content

Commit ce2edce

Browse files
author
Greg Soltis
committed
Switch default for LRU collection to disabled
1 parent 0979892 commit ce2edce

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestoreSettings.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ public final class FirebaseFirestoreSettings {
3131
@PublicApi public static final long CACHE_SIZE_UNLIMITED = -1;
3232

3333
private static final long MINIMUM_CACHE_BYTES = 1 * 1024 * 1024; // 1 MB
34-
private static final long DEFAULT_CACHE_SIZE_BYTES = 100 * 1024 * 1024; // 100 MB
34+
// TODO(b/121269744): Set this to be the default value after SDK is past version 1.0
35+
//private static final long DEFAULT_CACHE_SIZE_BYTES = 100 * 1024 * 1024; // 100 MB
36+
// For now, we are rolling this out with collection disabled. Once the SDK has hit version 1.0,
37+
// we will switch the default to the above value, 100 MB.
38+
private static final long DEFAULT_CACHE_SIZE_BYTES = CACHE_SIZE_UNLIMITED;
3539
private static final String DEFAULT_HOST = "firestore.googleapis.com";
3640
private static final boolean DEFAULT_TIMESTAMPS_IN_SNAPSHOTS_ENABLED = false;
3741

@@ -140,8 +144,9 @@ public Builder setTimestampsInSnapshotsEnabled(boolean value) {
140144
* guarantee that the cache will stay below that size, only that if the cache exceeds the given
141145
* size, cleanup will be attempted.
142146
*
143-
* <p>The default value is 100 MB. The threshold must be set to at least 1 MB, and can be set to
144-
* {@link FirebaseFirestoreSettings#CACHE_SIZE_UNLIMITED} to disable garbage collection.
147+
* <p>By default, collection is disabled (the value is set to
148+
* {@link FirebaseFirestoreSettings#CACHE_SIZE_UNLIMITED}). In a future release, collection will
149+
* be enabled by default, with a default cache size of 100 MB. The minimum value is 1 MB.
145150
*
146151
* @return A settings object on which the cache size is configured as specified by the given
147152
* {@code value}.

0 commit comments

Comments
 (0)