You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
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.
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 Cache-Control: max-age header Mapbox serves the tiles with?
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 deleteAmbientDatabase that deletes the database that we used to use before offline landed. (This method name needs to be clarified once this new API is introduced.)
To delete the current database, the developer would use similar code. The path could be obtained from OfflineManager.getDatabasePath() and the filename from OfflineManager.DATABASE_NAME.
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).
Worth noticing that #14365 resets the entire database, including ambient cache and offline regions. As per discussions with @kkaefer, we should be able to clear ambient cache independently from offline regions via SQL queries.
Activity
zugaldia commentedon Mar 18, 2016
Adding the
androidtag as the current situation affects Android similarly.tsemerad commentedon Sep 6, 2016
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.
1ec5 commentedon Sep 6, 2016
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).
tsemerad commentedon Sep 6, 2016
It's hosted on Mapbox. Do you know what
Cache-Control: max-ageheader Mapbox serves the tiles with?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.
zugaldia commentedon Sep 8, 2016
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
deleteAmbientDatabasethat deletes the database that we used to use before offline landed. (This method name needs to be clarified once this new API is introduced.)To delete the current database, the developer would use similar code. The path could be obtained from
OfflineManager.getDatabasePath()and the filename fromOfflineManager.DATABASE_NAME.In any case, I like the idea of adding a specific API in the SDK.
1ec5 commentedon Sep 8, 2016
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).
RomainQuidet commentedon Dec 6, 2016
Hi,
Any news about when this feature will be added ? which milestone ?
Thanks.
IOMA-5837: add clean ambient cache API, waiting for mapbox#4376
IOMA-5837: add clean ambient cache API, waiting for mapbox#4376
Superfuture commentedon Jan 27, 2017
Hi, any ETA on when this will be fixed? Thanks!
haydenkaizeta commentedon Sep 21, 2017
Android ETA?
rinigus commentedon Feb 24, 2018
If such API will be developed, would be great to get it for Qt as well.
jeffypooo commentedon Oct 26, 2018
+1 We'd love to have this feature.
zugaldia commentedon Feb 27, 2019
/cc: @tmpsantos for prioritization.
kkaefer commentedon Apr 26, 2019
PR is in #14365
brunoabinader commentedon Apr 29, 2019
Worth noticing that #14365 resets the entire database, including ambient cache and offline regions. As per discussions with @kkaefer, we should be able to clear ambient cache independently from offline regions via SQL queries.
[core] Add API for invalidating tiles
[core] Add API for invalidating tiles
[core] Add API for invalidating tiles