Hello,
We are trying to replicate what's heppening with this layer for example: https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=layers-featurelayer
It seems it is building a client side cache that's being used instead of throwing queries every time. Our layer has "supportCacheHint" set to true, but it's still not working.
Is there something we need to do to enable this caching?
Hi there,
The sample you referenced is not related to supportsCacheHint. At 4.19, we improved of performance of point FeatureLayers to fetch all its features at once from the server. Once loaded, the features won't need to be re-requested from the server, which will make future redraws after panning and zooming much faster.
Point feature layer fetches all of its features at once if the following conditions are met:
The point feature layer will request features as needed (do not fetch all features) if
1. Point layer is editable
2. If layer.refreshInterval is set and lastEditDate is `undefined` in the metadata.
The point layer referenced in the sample fetches all of features as once since it meets the requirements mentioned above.
If you enabled caching on your enterprise service (caching always enabled for hosted feature services), the JS API will take advantage of the server caching as it makes tile query requests for display. Please review this document for more info about caching.
If you are sending query requests from your app and the query params always the same you can set the cacheHint property on your query object.
Thanks a lot for your answer.
Is there a plan to support caching for polylines/polygons Feature Layers (with a smaller feature count for example)?
Yes we do have plans add support for fetching all polyline and polygon features at once if they meet certain requirements. However, I do not know what the timeline is. I will be sure to update you once we add support for this.