Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using esri's js api with arcserver 10.1 map services. My issue is that sometimes another application deletes a feature from the geodatabase that is the basis for my map service. But my browser does not react quickly to the change. It seems to be caching the map service response. This is evident in ie and firefox. Even a browser refresh will still show the feature that should have been deleted already. Is there a way to force the cache to flush and get new map service data?

share|improve this question
add comment

2 Answers 2

You should use the disableClientCaching on the Dynamic Map Services, and set it to true.

The help states:

When true, images are always requested from the server and the browser's cache is ignored. This should be used when the data supporting the map service changes frequently.

What this does, is to add a timestamp at the end of every request, so that every request is unique, and hence the client can't cache the response.

share|improve this answer
add comment

in addition to setting disableClientCaching, you can also set a refreshInterval on the layer in order to force new requests to the service even in instances where the user hasn't panned or zoomed.

https://developers.arcgis.com/javascript/jsapi/arcgisdynamicmapservicelayer-amd.html#refreshinterval

share|improve this answer
    
I have something similar in my code already but i think that it is not working because ie is not even processing the request because it sees that it is identical to the request before it. –  VBAHole Mar 19 at 20:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.