Hi there,
So the snapshot mode (we load all features on layer load) is enabled when one of the following conditions are met, otherwise layers will fetch its data as needed:
- If the layer has 0-80,000 points
- if the layer has 80,001 - 400,000 points and if the view's initial extent is greater than 10% of layer's data extent (i.e., we are not super zoomed in).
Snapshot should be very performant after the initial load. However, if you are making server side calls via refreshInterval or refresh() method, this can slow down the performance as the app has to download the entire data.
Have you considered using client-side filters like FeatureFilter or FeatureEffect on the FeatureLayerView? If you are querying your data also have you considered using client side queries via FeatureLayerView.queryFeatures()? Setting those properties and calling the those methods on the LayerView will take place on the client-side without having to fetch data from the server side.
I created a very simple test app where the layer is loaded in the snapshot mode. I have aded a few buttons where you can set the layer.definitionExpression versus layerView.filter. If you have the network tab open, you'll notice that setting layerView.filter does not generate network requests.
In any case, you can opt of out your layer loading in a snapshot mode by setting featurelayer-snapshot-enabled flag to 0. You can test this flag in the test app I provided by uncommenting the script tag added towards to beginning of the app: https://codepen.io/U_B_U/pen/dyVLKaG?editors=1000
I cannot reproduce the definitionExpression issue you are describing.