For web feature layers, a feature cache is used to improve performance and common tasks by storing features in a temporary folder. The cache is automatically managed and as features are cached, the number of queries needed to retrieve data is reduced and drawing time is improved. This can be useful when working with large or complex datasets, in a specific map extent, or when numerous users are using the same service. This also reduces strain on the server, as it reduces the number of service requests.
By default, the feature cache is filled automatically by the application; this is the recommended setting. The cache is filled each time the map has finished drawing and the following five criteria are met:
- The layer is visible in the Contents pane.
- The layer is displaying based on the visible scale range.
- The total number of features drawn is less than five times the row count threshold value on the service layer.
- The caching option on the layer properties dialog box is set to Clear cache when the session ends.
- The estimated number of features in the visible extent is less than five times the row count threshold value when filters are present.
To prevent long-running queries from overusing server resources when automatically caching features, there is a 15-second time-out on filling the feature cache per layer. When the cache of a layer takes longer than 15 seconds to fill, the request is canceled, the layer is marked as slow, and the automatic caching does not attempt to fill the cache again at the current or any smaller scale. At scales larger than 1/4 of the slow scale, an attempt is made to fill the layer automatically.
When the feature cache is not filled because the five criteria listed above are not satisfied or a 15-second time-out occurs, you can manage the cache manually to take advantage of the performance benefits provided by the cache.
Note:
Filters include display filters, definition queries, subtype group layers, and symbol classes.
Caution:
It is not recommended that you cache layers that are published with definition queries if you intend to edit them within ArcGIS AllSource. This is because service-based definition queries are not available to ArcGIS AllSource. When using these layers, edited or created features that do not meet the definition query may still display in ArcGIS AllSource even though they will not be visible in other applications. These features may disappear during the session and will disappear the next time ArcGIS AllSource is opened.
Additional details for the row count threshold, estimated row counts, and subtype group layers will also be used to determine whether the cache will fill automatically.
Row count threshold
The row count threshold is used to determine when the feature cache will fill. Row count threshold is set to 2,000 or the feature service layer maxRecordCount, whichever is lower.
Estimated row counts
When estimated row counts is supported and a layer has filters, ArcGIS AllSource will use estimated row counts and the five criteria described above to determine whether the feature cache will fill. If a layer does not have filters, estimated row counts will not be used and ArcGIS AllSource will use the first four criteria described above to determine whether the feature cache will fill.
If the estimated row counts of the entire feature service layer are less than five times the row count threshold, the feature cache is filled using snapshot mode. A single request is made and the feature cache is filled with all features from the service. With snapshot mode, spatial and nonspatial queries use the feature cache.
For feature service layers that do not support the estimated row counts, the feature cache is not filled if there are filters on the layers.
Note:
To determine whether the feature service supports estimated row counts, go to the layer's JSON resource and look for the infoInEstimates parameter. If count is seen within this array, ArcGIS AllSource will obtain estimated row counts. If the array is missing or does not contain count, ArcGIS AllSource will not obtain estimated row counts.
For more information on this parameter, see Get Estimates.
Subtype group layers
There are times in which subtype group layers may or may not be considered filters.
Subtype group layers are considered filters when at least one sublayer within is visible. For this scenario, estimated row counts will be used to fill the feature cache if supported.
Subtype group layers are not considered filters when all the subtype group layers are visible. For this scenario, the sum of the draw count from all visible subtype group layers will be used to determine whether the feature cache fills.
Subtype group layers are not considered filters when no subtype group layers are visible. For this scenario, the subtype group layers will be considered nonvisible and the feature cache will not be filled for these layers.