<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic cacheControlMaxAge Property is not working in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/724900#M3492</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My intent is to have cached features for 24 hours. I am following the instruction on this link &lt;A href="https://enterprise.arcgis.com/en/server/latest/publish-services/windows/feature-services-and-client-applications.htm"&gt;https://enterprise.arcgis.com/en/server/latest/publish-services/windows/feature-services-and-client-applications.htm &lt;/A&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;this is how response header looks like:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/450180_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this service in my application.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222;"&gt;arcgis/rest/services/........../FeatureServer/0/query?f=json&amp;amp;where=&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222;"&gt;this is how my service looks like regarding&amp;nbsp;cacheControlMaxAge&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222;"&gt;&lt;IMG class="image-1 jive-image" height="153" src="https://community.esri.com/legacyfs/online/450179_pastedImage_2.png" width="178" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Jun 2019 13:43:34 GMT</pubDate>
    <dc:creator>ShakibaMorvarid</dc:creator>
    <dc:date>2019-06-12T13:43:34Z</dc:date>
    <item>
      <title>cacheControlMaxAge Property is not working</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/724900#M3492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My intent is to have cached features for 24 hours. I am following the instruction on this link &lt;A href="https://enterprise.arcgis.com/en/server/latest/publish-services/windows/feature-services-and-client-applications.htm"&gt;https://enterprise.arcgis.com/en/server/latest/publish-services/windows/feature-services-and-client-applications.htm &lt;/A&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;this is how response header looks like:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/450180_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this service in my application.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222;"&gt;arcgis/rest/services/........../FeatureServer/0/query?f=json&amp;amp;where=&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222;"&gt;this is how my service looks like regarding&amp;nbsp;cacheControlMaxAge&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222;"&gt;&lt;IMG class="image-1 jive-image" height="153" src="https://community.esri.com/legacyfs/online/450179_pastedImage_2.png" width="178" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2019 13:43:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/724900#M3492</guid>
      <dc:creator>ShakibaMorvarid</dc:creator>
      <dc:date>2019-06-12T13:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: cacheControlMaxAge Property is not working</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/1219101#M4285</link>
      <description>&lt;P&gt;Hey I am running into the same issue. Did you ever resolve this?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 20:06:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/1219101#M4285</guid>
      <dc:creator>LanceKirby2</dc:creator>
      <dc:date>2022-10-05T20:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: cacheControlMaxAge Property is not working</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/1278637#M4463</link>
      <description>&lt;P&gt;Still doesn't seem to be working in Enterprise 10.9.1.&lt;/P&gt;&lt;P&gt;Reading some old documentation though, I don't think it's supposed to work for all MapServer endpoints:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Optional. Added in 10.2.1. If this property is set cache-control response header max-age value for REST API Export Map &lt;/SPAN&gt;&lt;SPAN class=""&gt;and tile resource responses will reflect the value set for this property. Otherwise default values will apply for max-age, &lt;/SPAN&gt;&lt;SPAN class=""&gt;which is 0 seconds(s) for export map, 86400 (s) for tiles that client can cache (clientCachingAllowed : true) and 0 (s) for tiles &lt;/SPAN&gt;&lt;SPAN class=""&gt;that disallow client caching (clientCachingAllowed : false). Please note cache-control header max-age value for tile responses will be &lt;/SPAN&gt;&lt;SPAN class=""&gt;always 0 if client caching is disallowed. Setting this property will have no effect in cache-control response header value for other &lt;/SPAN&gt;&lt;SPAN class=""&gt;operations/resources. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe the query endpoint counts as an other operations/resources.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 05:36:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/1278637#M4463</guid>
      <dc:creator>LeonAus</dc:creator>
      <dc:date>2023-04-14T05:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: cacheControlMaxAge Property is not working</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/1308100#M4506</link>
      <description>&lt;P&gt;I can confirm that the cacheControlMaxAge still isn't working as advertised in v11.1.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I opened a ticket with support on this and their response was:&amp;nbsp; "&lt;SPAN&gt;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."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have an idea what they mean but I don't know exactly and it appears as though it can't be reliably confirmed.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 22:45:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/1308100#M4506</guid>
      <dc:creator>ChrisBeaudette</dc:creator>
      <dc:date>2023-07-13T22:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: cacheControlMaxAge Property is not working</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/1536196#M4843</link>
      <description>&lt;P&gt;I spoke to one of the devs at the UC this year and he asked me to email about it. I will follow up when I do.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 18:18:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/1536196#M4843</guid>
      <dc:creator>LanceKirby2</dc:creator>
      <dc:date>2024-09-07T18:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: cacheControlMaxAge Property is not working</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/1601627#M4970</link>
      <description>&lt;P&gt;Found myself here hoping for the enlightenment but found everyone having the same issue...&lt;/P&gt;&lt;P&gt;tldr: I think it's working, just not obvious to prove....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/8268"&gt;@ChrisBeaudette&lt;/a&gt;'s (tag your it &lt;span class="lia-unicode-emoji" title=":smirking_face:"&gt;😏&lt;/span&gt;) response from esri is valid then there must be some other way to prove it's working so I kept digging a bit and think I found the way to verify it is in fact working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Setup:&lt;/P&gt;&lt;P&gt;V11.1 standalone server&lt;/P&gt;&lt;P&gt;Query operation on MapServer/1&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;cacheControlMaxAge":"3600"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've been expecting to see some clear 'it's from cache' cue in the chrome dev tools... but&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;never see a 304 response or 'disk/memory cache' in the size column and the response header always displays: the max-age:0;must-revalidate... chalking it up to the 'javascript fetch/etag' implementation and whatever about security that esri mentioned.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So, the chrome dev tools network tab has a handy little checkbox "Disable cache'.&amp;nbsp; Using this and the same service from two different servers (one with the cache control set and one without), I see this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Requests&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;to first server with cache control setting at 3600 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Enabled, Enabled, Disabled, Disabled, Enabled&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FredSpataro_0-1743549898958.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/129257i15C870F834EC0757/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FredSpataro_0-1743549898958.png" alt="FredSpataro_0-1743549898958.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I had been hitting the service a bunch so the first requests are already cached (small), then disable the local cache, boom... larger network transfer, then re-enable the local cache, back to smaller&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Requests to second server with cache control setting not defined&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Enabled, Enabled, Disabled, Disabled, Enabled,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FredSpataro_1-1743549984377.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/129256i101866E95C325FEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FredSpataro_1-1743549984377.png" alt="FredSpataro_1-1743549984377.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Always 709, as expected no difference b/c there's no cache setting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Painful but I think isn't enough to convince myself it's doing what I want and it's worth deploying the setting.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 23:35:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/cachecontrolmaxage-property-is-not-working/m-p/1601627#M4970</guid>
      <dc:creator>FredSpataro</dc:creator>
      <dc:date>2025-04-01T23:35:41Z</dc:date>
    </item>
  </channel>
</rss>

