I recently created a web app for road travel conditions using Web AppBuilder on ArcGIS Online, downloaded the code and hosted it on one of our servers. I am having a problem with cached data using a map service layer. Once you navigate back to an extent that you have previously been to a "304 Not Modified" is returned and cached data is displayed. Our road condition data changes frequently and I can't have old data displaying when someone goes back to an extent they have previously been to.
In the web map the refresh interval for this map service is not set. In other apps I have developed using the JavaScript API I can use the "setDisableClientCaching" parameter on the map service layer. Is there something similar that I can set in WAB? I tried setting it in the jimu.js/main.js with no luck.
Other layers in the app are brought into the web map as feature layers with refresh intervals set and they work great. The symbology being used for the road conditions is not supported as a feature layer so I am restricted to using a map service layer.
Any help is greatly appreciated.
If anyone else is having the same issue I found a workaround. I added some code in the "jimu/LayerInfos/LayerInfoFactory" function in the root/jimu.js/main.js file to disable client caching for the road conditions layer. Lines 30-33 below is what I added.