A singleton class to configure HTTP network caching options. More...
Import Statement: | import Esri.ArcGISRuntime 100.15 |
Since: | Esri.ArcGISRuntime 100.8 |
Inherits: |
Properties
- cacheDirectory : string
- cachePolicy : Enums.NetworkCachePolicy
- cacheSize : string
- cacheSizeAsInt : int
- maximumCacheSize : string
- maximumCacheSizeAsInt : int
- networkCachingEnabled : bool
Signals
- cacheDirectoryChanged()
- cachePolicyChanged()
- clearCacheCompleted()
- maximumCacheSizeChanged()
- networkCachingEnabledChanged()
- setCacheDirectoryCompleted()
- setCachePolicyCompleted()
- setMaximumCacheSizeCompleted()
- setNetworkCachingEnabledCompleted()
Methods
- void clearCacheAsync()
- void setCacheDirectoryAsync(string directory)
- void setCachePolicyAsync(Enums.NetworkCachePolicy policy)
- void setMaximumCacheSizeAsIntAsync(int maxSize)
- void setMaximumCacheSizeAsync(string maxSize)
- void setNetworkCachingEnabledAsync(bool enabled)
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
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"
The cache behavior for requests.
The default value is Enums.NetworkCachePolicyPreferNetwork
.
See also Enums.NetworkCachePolicy.
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.
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.
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.
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.
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
Emitted when the cacheDirectory property changes.
Note: The corresponding handler is onCacheDirectoryChanged
.
Emitted when the cachePolicy property changes.
Note: The corresponding handler is onCachePolicyChanged
.
Emitted when the clearCacheAsync method completes.
Note: The corresponding handler is onClearCacheCompleted
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Emitted when the maximumCacheSize property changes.
Note: The corresponding handler is onMaximumCacheSizeChanged
.
Emitted when the networkCachingEnabled property changes.
Note: The corresponding handler is onNetworkCachingEnabledChanged
.
Emitted when the setCacheDirectoryAsync method completes.
Note: The corresponding handler is onSetCacheDirectoryCompleted
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Emitted when the setCachePolicyAsync method completes.
Note: The corresponding handler is onSetCachePolicyCompleted
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Emitted when the setMaximumCacheSizeAsync method completes.
Note: The corresponding handler is onSetMaximumCacheSizeCompleted
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Emitted when the setNetworkCachingEnabledAsync method completes.
Note: The corresponding handler is onSetNetworkCachingEnabledCompleted
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Method Documentation
Asynchronously clears the cache directory.
Emits clearCacheCompleted on completion.
This method was introduced in Esri.ArcGISRuntime 100.15.
Asynchronously sets the cache directory to directory.
Emits setCacheDirectoryCompleted on completion.
This method was introduced in Esri.ArcGISRuntime 100.15.
See also cacheDirectory.
Asynchronously sets the cache policy to policy.
Emits setCachePolicyCompleted on completion.
This method was introduced in Esri.ArcGISRuntime 100.15.
See also cachePolicy.
Asynchronously sets the maximum cache size to maxSize.
Emits setMaximumCacheSizeCompleted on completion.
This method was introduced in Esri.ArcGISRuntime 100.15.
See also maximumCacheSizeAsInt.
Asynchronously sets the maximum cache size to maxSize.
Emits setMaximumCacheSizeCompleted on completion.
This method was introduced in Esri.ArcGISRuntime 100.15.
See also maximumCacheSize.
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.