parse-community / Parse-SDK-Android

The Android SDK for Parse Platform
https://parseplatform.org/
Other
1.88k stars 735 forks source link

Add ability to configure max cache size and and count for ParseKeyValueCache #1098

Open evtimmy opened 3 years ago

evtimmy commented 3 years ago

Right now ParseKeyValueCache has two configuration variables, but those have package visibility and can't be changed from the app.

The current config variables default to 2MB and 1000 requests:

    /* package */ static int maxKeyValueCacheBytes = DEFAULT_MAX_KEY_VALUE_CACHE_BYTES;
    /* package */ static int maxKeyValueCacheFiles = DEFAULT_MAX_KEY_VALUE_CACHE_FILES;

Simplest way is to expose these as public, but perhaps a better configuration API could be devised? Something along the lines of:

public static configure(maxSizeInBites, maxQueryCount)