Control cache age

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, which decreases 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. Users signed in to the organization see the latest data, however.

Complete the following steps to change the maximum cache age for qualifying public layers:

  1. Sign in to your organization.

    You must be the layer owner or a member of the default administrator role or a custom role assigned the set of privileges to manage all content owned by organization members.

  2. Open the item page for the public hosted feature layer or secure service item.
  3. Click the Settings tab.
  4. Scroll to the Cache control section and choose the maximum amount of time that the users using the layer have to wait before they receive updates to the data in the layer.

    This setting is not available for hosted feature layers that have editing enabled and is not available for secure ArcGIS Server feature services.