cacheControlMaxAge Property is not working

987
3
06-12-2019 06:43 AM
ShakibaMorvarid
New Contributor

My intent is to have cached features for 24 hours. I am following the instruction on this link https://enterprise.arcgis.com/en/server/latest/publish-services/windows/feature-services-and-client-...

I set cacheControlMaxAge to 24 hours on ArcGIS Admin but when I see the response header still the max-age is 0. I appreciate if anyone can help.

this is how response header looks like:

I am using this service in my application. 

arcgis/rest/services/........../FeatureServer/0/query?f=json&where=

this is how my service looks like regarding cacheControlMaxAge

0 Kudos
3 Replies
LanceKirby2
Occasional Contributor II

Hey I am running into the same issue. Did you ever resolve this?

0 Kudos
LeonAus
New Contributor III

Still doesn't seem to be working in Enterprise 10.9.1.

Reading some old documentation though, I don't think it's supposed to work for all MapServer endpoints:

Optional. Added in 10.2.1. If this property is set cache-control response header max-age value for REST API Export Map and tile resource responses will reflect the value set for this property. Otherwise default values will apply for max-age, which is 0 seconds(s) for export map, 86400 (s) for tiles that client can cache (clientCachingAllowed : true) and 0 (s) for tiles that disallow client caching (clientCachingAllowed : false). Please note cache-control header max-age value for tile responses will be always 0 if client caching is disallowed. Setting this property will have no effect in cache-control response header value for other operations/resources.

 

Maybe the query endpoint counts as an other operations/resources. 

0 Kudos
ChrisBeaudette
Occasional Contributor

I can confirm that the cacheControlMaxAge still isn't working as advertised in v11.1.  

I opened a ticket with support on this and their response was:  "We're thinking that because of security the developer tools may not be able to read the cache control max age based on the JSON. As long as in the properties of the service it sys that the cache control max age is set, it is considered to be functioning as expected."

I have an idea what they mean but I don't know exactly and it appears as though it can't be reliably confirmed.

0 Kudos