-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add API to clear ambient cache #4376
Comments
Adding the |
Is there still no way to clear the ambient cache, other than reinstalling the app? I'm finding that when I update a tileset, my iOS client is still holding onto the previous tiles. Previously-cached tiles still show the old data, but fetching new tiles show the new data. |
Is this tile set hosted by Mapbox or by you? If you’re hosting your own tile set, you can set a caching header in the HTTP response to force regular refreshes: #4446 (comment). |
It's hosted on Mapbox. Do you know what Hosting the tiles myself wouldn't be ideal, but I can do so if necessary. But doesn't the new offline caching functionality (where you set a region) require that the tiles be hosted by Mapbox? Maybe I'm misremembering. |
Just noting that, on Android, this is something that can easily be implemented by the developer today. For reference, we currently have a private method To delete the current database, the developer would use similar code. The path could be obtained from In any case, I like the idea of adding a specific API in the SDK. |
Similarly, on iOS and macOS, it’s possible to delete the database (which contains all cached content, including downloaded offline packs) by pointing NSFileManager to this path. But the location of that file may change in a future release without notice, it’s probably only safe to touch this file before you use MGLMapView or MGLOfflineStorage in any way, and we don’t make any promises about how well this workaround would work even today. I’d expect the same caveats to apply to the Android SDK. So I’m pretty sure deleting the database isn’t an option for the use case described in #4376 (comment). |
Hi, |
Hi, any ETA on when this will be fixed? Thanks! |
Android ETA? |
If such API will be developed, would be great to get it for Qt as well. |
+1 We'd love to have this feature. |
/cc: @tmpsantos for prioritization. |
PR is in #14365 |
Add new APIs for invalidating tiles, effectively forcing Mapbox GL Native to check with the servers if the tiles are valid before using them. This is more efficient then deleting tiles, because in case of valid tiles, they won't get downloaded. Fixes #4376.
Add new APIs for invalidating tiles, effectively forcing Mapbox GL Native to check with the servers if the tiles are valid before using them. This is more efficient then deleting tiles, because in case of valid tiles, they won't get downloaded. Fixes #4376.
Add new APIs for invalidating tiles, effectively forcing Mapbox GL Native to check with the servers if the tiles are valid before using them. This is more efficient then deleting tiles, because in case of valid tiles, they won't get downloaded. Fixes #4376.
As of #4376, all cached resources are located in a file in Application Support instead of Caches, so any disk space taken up by ambient caching cannot be automatically reclaimed by iOS when disk space runs low. These resources are only removed when the application is deleted. This would become more of a problem if the application is permitted to raise the ambient cache size (#3437).
Perhaps MGLOfflineStorage should have a method that clears the ambient cache contents in the unified cache file, leaving any downloaded offline content intact. The application could provide UI for reclaiming the space taken up by ambient caching.
/cc @jfirebaugh
The text was updated successfully, but these errors were encountered: