Select to view content in your preferred language

Question about refreshInterval behavior

536
1
Jump to solution
03-08-2022 03:43 AM
HanochS
Emerging Contributor

Hi,

I just want to see if I understood correctly the refreshInterval behavior:

if I have several layers on the map (3 for example) and on each one of them I set the refreshinterval to be 6 sec so every 6 sec I will see 3 requests to refresh the data? 1 request for each layer or 1 request for all?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

Depends on what version of the API we are talking about here. At 4.21 and 4.22, we made improvements to refreshable layers. 

At 4.21: https://developers.arcgis.com/javascript/latest/4.21/#refreshable-layers, we made changes to FeatureLayer refresh logic. 

  • To reduce load on the server and minimize unnecessary requests, the FeatureLayer will only request data at its specified refreshInterval if the lastEditDate in the layer's metadata has changed. If the FeatureLayer does not have lastEditDate info, then the layer will refresh unconditionally.
  • We added support for refreshInterval and refresh method on WFSLayer at 4.21.
  • We added support for refreshInterval and refresh method on GeoJSONLayer, CSVLayer and GeoRSSLayer at 4.22

So if you have a FeatureLayer has has LastEditDate, then you will not see refresh requests to the service unless the lastEditDate changes (meaning the data has changed). This is the only time you will see requests to the service. 

For other layers, yes you should see requests at specified intervals. You will requests for all layers. Number of requests won't match the number of layers. You can see multiple requests for each layer. We need to fetch enough data to cover the view.extent. 

View solution in original post

1 Reply
UndralBatsukh
Esri Regular Contributor

Hi there, 

Depends on what version of the API we are talking about here. At 4.21 and 4.22, we made improvements to refreshable layers. 

At 4.21: https://developers.arcgis.com/javascript/latest/4.21/#refreshable-layers, we made changes to FeatureLayer refresh logic. 

  • To reduce load on the server and minimize unnecessary requests, the FeatureLayer will only request data at its specified refreshInterval if the lastEditDate in the layer's metadata has changed. If the FeatureLayer does not have lastEditDate info, then the layer will refresh unconditionally.
  • We added support for refreshInterval and refresh method on WFSLayer at 4.21.
  • We added support for refreshInterval and refresh method on GeoJSONLayer, CSVLayer and GeoRSSLayer at 4.22

So if you have a FeatureLayer has has LastEditDate, then you will not see refresh requests to the service unless the lastEditDate changes (meaning the data has changed). This is the only time you will see requests to the service. 

For other layers, yes you should see requests at specified intervals. You will requests for all layers. Number of requests won't match the number of layers. You can see multiple requests for each layer. We need to fetch enough data to cover the view.extent.