Optimising Your Caching Strategy

To ensure beacons are discovered at the right time, there are a number of options available to customise how beacon metadata is retrieved and cached in your app. See SDK Options for full details on SDK settings. Use caution when using options that cache all beacons in large and/or closely installed networks as this may adversely affect the performance of your app.

1. Only load beacons as they are discovered or in nearby locations by geo-fence (default behaviour):

Java
BC_OPTION_CACHE_ALL_BEACONS_FOR_APP: "false"
BC_OPTION_DISCOVER_BEACONS_NEARBY: "true"
Objective-C
BCOptionCacheAllBeaconsForApp:NO
BCOptionDiscoverBeaconsNearby:YES
Swift
BCOptionCacheAllBeaconsForApp: false
BCOptionDiscoverBeaconsNearby: true

2. Load all beacons and sites for the app and ignore all other beacons:

Java
BC_OPTION_CACHE_ALL_BEACONS_FOR_APP: "true"
BC_OPTION_DISCOVER_BEACONS_NEARBY: "false"
Objective-C
BCOptionCacheAllBeaconsForApp:YES
BCOptionDiscoverBeaconsNearby:NO
Swift
BCOptionCacheAllBeaconsForApp: true
BCOptionDiscoverBeaconsNearby: false

3. Load all beacons for app first, then discover other public beacons nearby:

Java
BC_OPTION_CACHE_ALL_BEACONS_FOR_APP: "true"
BC_OPTION_DISCOVER_BEACONS_NEARBY: "true"
Objective-C
BCOptionCacheAllBeaconsForApp:YES
BCOptionDiscoverBeaconsNearby:YES
Swift
BCOptionCacheAllBeaconsForApp: true
BCOptionDiscoverBeaconsNearby: true

4. Don’t sync any discovered beacons:

Java
BC_OPTION_CACHE_ALL_BEACONS_FOR_APP: "false"
BC_OPTION_DISCOVER_BEACONS_NEARBY: "false"
Objective-C
BCOptionCacheAllBeaconsForApp:NO
BCOptionDiscoverBeaconsNearby:NO
Swift
BCOptionCacheAllBeaconsForApp: false
BCOptionDiscoverBeaconsNearby: false