How to Configure Edge Settings in App Platform

Validated on 18 May 2021 • Last edited on 21 Aug 2025

App Platform is a Platform-as-a-Service (PaaS) offering that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure.

If your app contains cacheable content, such as images and website data, you can improve the performance of your app for end users by implementing the Cache-Control header in your app’s HTTP responses.

The Cache-Control header in an HTTP request or response instructs web browsers and CDN edge servers to cache the content of a request for a specified period of time. This keeps subsequent requests and responses for the same content closer to the end user by caching it on local CDN edge servers or web browsers, which reduces response times and traffic on your app.

By default, App Platform deploys static sites with Cache-Control headers set to cache for 24 hours on CDN edge servers and 10 seconds in web browsers. If you redeploy the app, any cached content is invalidated across the web and CDN servers and web browsers will cache the latest iteration of the website upon any new traffic to the app.

Responses from dynamic apps served by service resources are not cached by default. To enable caching, you must set the Cache-Control header in the app’s HTTP response functions.

For example, in this Go example, we have set the Cache-Control header in the HTTP handler function to cache responses for 86400 seconds (24 hours):

http.HandleFunc("/cached", func(w http.ResponseWriter, r *http.Request) {
  w.Header().Set("Cache-Control", "public, max-age=86400")
  // rest of the response logic
})

How to implement the Cache-Control header into your app depends on the language and framework your app is based on. Reference the language’s documentation on how to do this.

Disable CDN Cache

You can disable an app service’s CDN cache, allowing you to use your own CDN, use SSE, and build MCP servers. To disable the cache, first update your app spec by setting disable_edge_cache to true:

name: my-app
disable_edge_cache: true

Then, set the following headers in your app, setting Cache-Control to no-cache:

'Content-Type': 'text/event-stream'
'Cache-Control': 'no-cache'

You cannot disable the cache for apps with static sites. As a workaround, you can either create a new app for that static component or serve the static site from a service component.

Disable Email Obfuscation

By default, App Platform obfuscates email addresses in your HTML content to protect them from spam bots. To disable email obfuscation and display email HTML as-is, update your app spec with the following:

name: my-app
disable_email_obfuscation: true

Enhanced Threat Control

Enhanced Threat Control mode provides additional protection against layer 7 DDoS attacks and malicious traffic by challenging suspicious requests before they reach your app. To enable Enhanced Threat Control, update your app spec with the following:

name: my-app
enhanced_threat_control_enabled: true

Every edge settings feature requires a custom domain and does not work with the starter domain. Edge settings are boolean values. Setting them to false or removing them from your app spec restores their default behavior. Changes to edge settings may take up to 30 seconds to propagate.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.