Skip To Content ArcGIS for Developers Sign In Dashboard

NetworkCacheConfiguration QML Type

A singleton class to configure HTTP network caching options. More...

Import Statement: import Esri.ArcGISRuntime 100.8
Since: Esri.ArcGISRuntime 100.8
Inherits:

Object

Properties

Signals

Methods

Detailed Description

Network requests can be cached locally to improve performance and reduce the number of network requests. Access the singleton instance through RequestConfiguration.globalNetworkCacheConfiguration.

Property Documentation

cacheDirectory : string

The directory to store the cached responses.

The default path is the value returned by QStandardPaths::CacheLocation and depends on the platform:

  • MacOS - "~/Library/Caches/<APPNAME>" or "/Library/Caches/<APPNAME>".
  • Windows - "C -/Users/<USER>/AppData/Local/<APPNAME>/cache".
  • linux - "~/.cache/<APPNAME>"
  • Android - "<APPROOT>/cache" or "<USER>/<APPNAME>/cache"
  • iOS - "<APPROOT>/Library/Caches"

cachePolicy : Enums.NetworkCachePolicy

The cache behavior for requests.

The default value is Enums.NetworkCachePolicyPreferNetwork.

See also Enums.NetworkCachePolicy.


cacheSize : string

Returns the current size taken up by the cache (read-only).

Returns 0 if the cache is disabled.

Note: The underlying Runtime property is represented as a 64-bit integer type. See Accessing 64-bit integer properties from QML.

See also cacheSizeAsInt.


cacheSizeAsInt : int

Returns the current size taken up by the cache, but represented as an integer type (read-only).

Returns 0 if the cache is disabled.

Note: The underlying Runtime property is represented as a 64-bit integer type. See Accessing 64-bit integer properties from QML.

See also cacheSize.


maximumCacheSize : string

The maximum size for the disk cache in bytes.

The default value is 100 MBs (100,000,000 bytes).

Note: The underlying Runtime property is represented as a 64-bit integer type. See Accessing 64-bit integer properties from QML.

See also maximumCacheSizeAsInt.


maximumCacheSizeAsInt : int

The maximum size for the disk cache in bytes, but represented as an integer type.

The default value is 100 MBs (100,000,000 bytes).

Note: The underlying Runtime property is represented as a 64-bit integer type. See Accessing 64-bit integer properties from QML.

See also maximumCacheSize.


networkCachingEnabled : bool

Whether the network caching is enabled.

This is a global setting and applies to all network requests.

The default value is true.

When set to false, no disk caching will be used. When set to true, network requests will attempt to cache results and use those as possible when the same request is made again.

Network caching can improve the performance of loading network resources.


Signal Documentation

cacheDirectoryChanged()

Emitted when the cacheDirectory property changes.


cachePolicyChanged()

Emitted when the cachePolicy property changes.


maximumCacheSizeChanged()

Emitted when the maximumCacheSize property changes.


networkCachingEnabledChanged()

Emitted when the networkCachingEnabled property changes.


Method Documentation

void clearCache()

Clears the cache directory.



Feedback on this topic?