Select to view content in your preferred language

How is the cacheControlMaxAge intended to work and be used?

535
2
04-01-2024 11:11 AM
RyanUthoff
Frequent Contributor

I am trying to optimize our feature services as much as possible and noticed there is a cacheControlMaxAge parameter. I was able to successfully set this parameter because I can see that parameter being set when watching the internet traffic (see this Esri article for reference https://enterprise.arcgis.com/en/server/latest/publish-services/windows/feature-services-and-client-...)

However, I was wondering how the cacheControlMaxAge is intended to be used, or if it works how I think it's supposed to work?

What I would like, and what appears that this feature is intended to do per the documentation, is to temporarily cache the results of the feature service in a map viewer for X minutes so if someone pans around in the map, it won't resend that request for features that are already drawn to the ArcGIS Server and therefore saving internet bandwidth and server resources.

However, in my testing, I am seeing that features are not actually getting cached in the browser. For example, I will open a map and load a few layers. I will then edit the layer directly in the DB through ArcGIS Pro. Then, still within the cache timeframe, I will pan around and see that the data has been updated. To my understanding, if the data is truly cached, I should not be able to see any data updates until I reach the cache max age, correct?

If I am correct, that is not working properly in my test environment. And if I am not correct, can someone tell me how the cacheControlMaxAge is intended to work and be used?

0 Kudos
2 Replies
AndresEcheverri
Regular Contributor

Hi Ryan
Having the same issue. Even after the cacheControlMaxAge was set up to a number different than 0, the web service seems to be sending the request to the server, and not getting the cache from the web browser cache. Did you find any answer to this problem?.

0 Kudos
RyanUthoff
Frequent Contributor

Nope, I just gave up. I'm assuming it's either a bug or I'm misunderstanding how that functionality works considering how little documentation there is about it. 50/50 on which one it is.