Control cache

When you share a hosted feature layer or secure ArcGIS Server web service layer with stored credentials with the public, ArcGIS Online uses a content delivery network (CDN) to optimize the layer's performance and reduce server load.

As you pan the map and interact with the layer, the app requests data. The CDN caches the information returned from the server for those requests. This response cache decreases the amount of time it takes to load a map containing the layer, improves responsiveness of apps that use the layer, and, therefore, leads to a better experience when interacting with the layer.

The data in the layer can change on the server. Therefore, the CDN and your browser check for updates periodically. The amount of time, in minutes, between these checks is referred to as the maximum cache age. Once the maximum cache age is reached, the cache is refreshed. Fewer checks for updates means improved performance; however, it also means people who are using the public layer without signing in to your organization (anonymous users) wait longer to see the latest data.

You can increase the maximum cache age setting, thereby decreasing the frequency with which the browser and CDN check for changes.

Before increasing the maximum cache age on a layer you share with the public, consider the following:

  • Changes to the data may not be publicly available until after the current CDN cache expires. For example, if you increase the maximum cache age from 30 seconds to 5 minutes, the CDN waits 5 minutes before a request prompts it to check for updated data.
  • If you stop sharing the layer with the public, cached responses temporarily remain on the CDN until the cache expires. This means if the maximum cache age is set to 5 minutes, it can take up to 5 minutes before the layer is inaccessible to the public. People signed in to the organization see the latest data, however.

Only the layer owner or an administrator can change the maximum cache age. This setting is not available for hosted feature layers that have editing or sync enabled and is not available for secure ArcGIS Server feature services at all.

Follow these steps to change the maximum cache age for your qualifying public layers:

  1. Sign in to your organization and open the details for the public hosted feature layer or secure service item.
  2. Click the Settings tab.
  3. Scroll to the Cache Control section and choose the maximum amount of time that the people using the layer have to wait before they see updates to the data in the layer.

    If you choose Never, the CDN checks for updates whenever apps request data for the layer.