NetworkCacheConfiguration QML Type

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

Import Statement: import Esri.ArcGISRuntime 100.15
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.

The Runtime networking code operates on its own thread, so modifying cache properties involves asynchronous calls to a different thread. Completions will be reported on signals.

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.

Note: The corresponding handler is onCacheDirectoryChanged.


cachePolicyChanged()

Emitted when the cachePolicy property changes.

Note: The corresponding handler is onCachePolicyChanged.


clearCacheCompleted()

Emitted when the clearCacheAsync method completes.

Note: The corresponding handler is onClearCacheCompleted.

This signal was introduced in Esri.ArcGISRuntime 100.15.


maximumCacheSizeChanged()

Emitted when the maximumCacheSize property changes.

Note: The corresponding handler is onMaximumCacheSizeChanged.


networkCachingEnabledChanged()

Emitted when the networkCachingEnabled property changes.

Note: The corresponding handler is onNetworkCachingEnabledChanged.


setCacheDirectoryCompleted()

Emitted when the setCacheDirectoryAsync method completes.

Note: The corresponding handler is onSetCacheDirectoryCompleted.

This signal was introduced in Esri.ArcGISRuntime 100.15.


setCachePolicyCompleted()

Emitted when the setCachePolicyAsync method completes.

Note: The corresponding handler is onSetCachePolicyCompleted.

This signal was introduced in Esri.ArcGISRuntime 100.15.


setMaximumCacheSizeCompleted()

Emitted when the setMaximumCacheSizeAsync method completes.

Note: The corresponding handler is onSetMaximumCacheSizeCompleted.

This signal was introduced in Esri.ArcGISRuntime 100.15.


setNetworkCachingEnabledCompleted()

Emitted when the setNetworkCachingEnabledAsync method completes.

Note: The corresponding handler is onSetNetworkCachingEnabledCompleted.

This signal was introduced in Esri.ArcGISRuntime 100.15.


Method Documentation

void clearCacheAsync()

Asynchronously clears the cache directory.

Emits clearCacheCompleted on completion.

This method was introduced in Esri.ArcGISRuntime 100.15.


void setCacheDirectoryAsync(string directory)

Asynchronously sets the cache directory to directory.

Emits setCacheDirectoryCompleted on completion.

This method was introduced in Esri.ArcGISRuntime 100.15.

See also cacheDirectory.


void setCachePolicyAsync(Enums.NetworkCachePolicy policy)

Asynchronously sets the cache policy to policy.

Emits setCachePolicyCompleted on completion.

This method was introduced in Esri.ArcGISRuntime 100.15.

See also cachePolicy.


void setMaximumCacheSizeAsIntAsync(int maxSize)

Asynchronously sets the maximum cache size to maxSize.

Emits setMaximumCacheSizeCompleted on completion.

This method was introduced in Esri.ArcGISRuntime 100.15.

See also maximumCacheSizeAsInt.


void setMaximumCacheSizeAsync(string maxSize)

Asynchronously sets the maximum cache size to maxSize.

Emits setMaximumCacheSizeCompleted on completion.

This method was introduced in Esri.ArcGISRuntime 100.15.

See also maximumCacheSize.


void setNetworkCachingEnabledAsync(bool enabled)

Asynchronously sets the network caching to enabled.

This is a global setting and applies to all network requests. Emits setNetworkCachingEnabledCompleted on completion.

This method was introduced in Esri.ArcGISRuntime 100.15.

See also networkCachingEnabled.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.