Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] offline and cache policy #4350

Closed
RomainQuidet opened this issue Mar 16, 2016 · 11 comments
Closed

[core] offline and cache policy #4350

RomainQuidet opened this issue Mar 16, 2016 · 11 comments
Labels

Comments

@RomainQuidet
Copy link
Contributor

I can't find any document about the cache and offline maps policies.
If there is no document, could you explain:

  • cache database
    • does it handle vector only maps or also raster png files ? Does it cache mapbox tiles only or also custom tiles providers ?
    • max cache size: what size, can we change it ?
    • expire policy: what is the expire delay, how can it be changed ?
    • expire policy: can expire delay be different according to tiles style ?
    • expire policy: if tiles expire, is it automatically removed ?
    • on maximum size reached, does it stop to record or do you have a ring cache (older tiles are removed for newer ones).
  • offline maps
    • does it handle vector only maps or also raster png files ? Does it cache mapbox tiles only or also custom tiles providers ?
    • expire policy: what is the expire delay, how can it be changed ?
    • expire policy: if tiles expire, is it automatically removed ?

Thanks

@zugaldia
Copy link
Member

/cc: @jfirebaugh and @danswick @cammace for documentation.

@RomainQuidet
Copy link
Contributor Author

Thanks for sending https://www.mapbox.com/blog/offline-mobile-maps/ but it's too generic and does not contain the responses for all the questions.

@jfirebaugh
Copy link
Contributor

@RomainQuidet
Copy link
Contributor Author

@jfirebaugh yes thanks, but I can't find the cache policy for expiration for example. it's quite generic. What about raster tiles too ?

@jfirebaugh
Copy link
Contributor

Raster tiles and non-Mapbox URLs are both supported. Revalidation follows the HTTP standard, using the Cache-Control and Expires headers. The maximum cache size for non-offline use is 50 MB and eviction from it is LRU. There is no size limit or automatic eviction for offline resources.

@jfirebaugh
Copy link
Contributor

Clarification on the above points is in the works for https://www.mapbox.com/help/mobile-offline/.

@RomainQuidet
Copy link
Contributor Author

@jfirebaugh Thanks for the clarifications.
One more question: on the section ambient caching, you write

These resources are stored in the same database as offline resources
about cache and offline.

On iOS 3.2.0-pre3, I can see the map using "cache.db" on init, and the offline storage creating "offline.db" file on the singleton init. Is it correct ?
I can see that the default source cache.db used by the mapView, but I can't see where the map is using the offline storage.
Thanks.
cc @1ec5

@jfirebaugh
Copy link
Contributor

Yeah, that's a bug. Thanks for bringing that to our attention. Ticketed as #4362.

@BilalPervez
Copy link

@jfirebaugh as you mention on your last comment "There is no size limit or automatic eviction for offline resources".
According to my understanding we need to call "removePack" function to delete the offline storage tiles/resources but my app space still remain same after deleting the offline packs. and 6000 tiles limit error occur even I have no offline packs.

@zugaldia
Copy link
Member

zugaldia commented Aug 2, 2019

According to my understanding we need to call "removePack" function to delete the offline storage tiles/resources but my app space still remain same after deleting the offline packs.

Currently removing a pack only marks the tiles for deletion but it doesn't immediately free up the space. To do that, you need to use separate APIs we've introduced recently and that you can see here: #14978 (there's a blog post and documentation updates coming soon that explain the usage of these new APIs in more detail).

Meanwhile, for any additional questions about SDK usage, please reach out to Mapbox Support. We only use this repo for tracking issues with the SDK (feel free to cut a separate ticket if that's the case, thanks!).

@BilalPervez
Copy link

@zugaldia thanks for the answer. that's what i need for removing ambient caching from my device which i found in new version Mapbox SDK.
One more question about IOS mapbox sdk is that when i load downloaded large size offline map (about 2.0 GB or more) it loads on mapview with a lot of delay and map loading process becoming too slow after that, and "removepack" callback function takes 30-40 sec or more to delete the pack of size 2 GB which is irritating for the user to wait until its deleted.
what can be the solution of these two problem so my offline map features run smoothly?
your answer will be appreciated :) .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@zugaldia @jfirebaugh @RomainQuidet @BilalPervez and others