When I disable WiFi and a map view is re-created, it doesn't show any map, the cache is not loading.

208
1
04-08-2024 12:34 PM
MariaPaulaGomezPrieto
New Contributor

Hi, we are using version 200.3.0, but the cache is not working.


I charge the map with the device online, once the map is loaded, I change my device to offline mode, but the map is not loading. I checked the ArcGISEnvironment.arcGISHttpClient.cache.httpCache.cache value and the directory has a lot of cache files, but the map is not using them.

I even tried to change the cache maxSize, and the directory, but I had the same issue.

Screenshot 2024-04-08 at 12.14.07 PM.png

Screenshot 2024-04-08 at 12.14.46 PM.png

0 Kudos
1 Reply
Nicholas-Furness
Esri Regular Contributor

Hello,

HTTP caching, while useful for reducing duplicate requests for the same data as you pan and zoom around the map, and for improving performance for the end user, is not designed to take a map offline. It's not that we prevent that from working, but there is a lot of metadata beyond just the raw map content that needs to be cached and returned by the underlying HTTP stack, and you're at the mercy of how the caching works on a particular platform (with the Kotlin SDK, it's OkHttp). Being able to do this is something that's on our radar, but it's a way off yet.

The recommended and supported process for taking maps offline is to proactively download them using the OfflineMapTask API. This is a much more deliberate process; web map and data service configuration is required to enable this behavior, and the application needs to expressly make use of APIs to download the map. You can learn more here.

Hope this helps!