How to configure ArcGIS Runtime local tiles cache mechanism?

1440
7
03-25-2020 09:35 AM
ArnelLedo
New Contributor II

Is there any way on ArcGIS .Net Runtime to configure a folder so while the user navigates the map the tiles will be downloaded/cached to that folder to avoid unnecessary requests to the server to obtain the same tiles?

If that is the case, what type of layers support this caching mechanism?

Please notice I am not talking about downloading a map for online use.

Thanks in advance.

0 Kudos
7 Replies
dotMorten_esri
Esri Notable Contributor

If the server says that tiles are ok to cache (it usually does), tiles are being cached. It's not really a layer specific thing. Any web response that a server set the cache control or etag headers on will be cached and will also auto-expire based on those headers.

0 Kudos
ArnelLedo
New Contributor II

So in case the server is configured to support caching, how will the map control cache the tiles, in memory, file system?

Is there anything I can do to enable/disable it? Any kind of configuration?

0 Kudos
dotMorten_esri
Esri Notable Contributor

Depends on the platform, but it typically rely on operation system level caching (which is on-disk)

0 Kudos
ArnelLedo
New Contributor II

I am using the WPF Runtime, I don't find any way to configure that caching mechanism. Does the runtime provide something to achieve that? What's the path to the folder where the cache is stored?

Thanks for answering.

0 Kudos
dotMorten_esri
Esri Notable Contributor

For WPF, you'll find that in the Internet Options of Windows: 

There's no runtime specific API for this. It's something Windows just provides out of the box for wininet (which is what sits under .NET Framework's HttpClient APIs).

I'm curious though why you need an API for this? Could you share what your scenario is?

0 Kudos
ArnelLedo
New Contributor II

We just want to confirm that the map will reuse the cached tiles even when there is an active connection with the tile server to reduce the number of requests.

But I see that the cache as you mentioned is based on the Operation System caching mechanism, is not like if the runtime has any caching mechanism in place. That's why I was expecting a folder where I can go and see the *.png (or whatever format) tiles. Then the API could allow configuring the path to that folder, maybe the total size of the tiles images that will be saved, etc.

0 Kudos
dotMorten_esri
Esri Notable Contributor

The best way to confirm that, is to use Fiddler (fiddlertool.com). You should either see requests not being repeated, or lots of 304 responses (the latter is if the server only uses ETags with no expiration set, which means we must revalidate the tile each time we request it)

0 Kudos