Skip to content

Switch default for LRU collection to disabled #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public final class FirebaseFirestoreSettings {
@PublicApi public static final long CACHE_SIZE_UNLIMITED = -1;

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

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