Docs Menu
Docs Home
/ /
Atlas App Services
/ /

Flush the CDN Cache

On this page

  • Overview
  • Procedure

Atlas App Services serves hosted files through a Content Delivery Network (CDN) in order to minimize the latency between receiving a request for a resource and returning the requested resource.

When a client requests a resource that's hosted in App Services, the CDN server that processes the request checks for a cached copy of the file. If the server finds a valid cached copy of the resource, it returns it to the client. Otherwise, it forwards the request to App Services and caches the returned file before returning it to the client.

The CDN caching process decreases the latency for end users when they request a resource but may cause users to receive an out-of-date version of a resource if the file has changed since the CDN server cached it. You can flush the CDN cache in order to make it drop all cached files and start serving the latest version of each file.

Note

Automatic Cache Invalidation

The CDN automatically refreshes cached files periodically. You can configure the caching behavior for an individual file by adding a a Cache-Control attribute to the file.

1

Click Hosting in the left navigation menu.

2

You can purge the cache for all hosted files from the Files tab.

  1. Click the Actions button above the list of files.

  2. Click Purge Cache.

  3. In the Purge Cache modal, click Confirm.

3

The new metadata attribute will not have a type or value when you first add it.

  1. Select the attribute type from new attribute's dropdown menu.

  2. Enter a value for the attribute in the input box.

  3. Click Save.

1

To purge the CDN cache with the App Services CLI, you need a local copy of your application's configuration files.

To pull a local copy of the latest version of your app, run the following:

appservices pull --remote="<Your App ID>"

Tip

You can also download a copy of your application's configuration files from the Deploy > Import/Export App screen in the App Services UI.

2

To purge the CDN cache, re-deploy your application configuration with the --reset-cdn-cache flag:

appservices push --remote="<Your App ID>" --reset-cdn-cache

Back

File Metadata Attributes

On this page