

# Managing the cache configuration for an app
<a name="caching"></a>

Amplify uses Amazon CloudFront to manage the caching configuration for your hosted applications. A cache configuration is applied to each app to optimize for the best performance.

On August 13, 2024, Amplify released improvements to caching efficiency for applications. For more information, see [CDN Caching Improvements for Better App Performance with AWS Amplify Hosting](https://aws.amazon.com/blogs/mobile/cdn-caching-improvements-for-better-app-performance-with-aws-amplify-hosting/). 

The following table summarizes Amplify support for specific caching behaviors before and after the caching improvements release.


| Caching behavior | Previous support | With caching improvements | 
| --- | --- | --- | 
| You can add custom headers for an app in the Amplify console or in a `customHeaders.yaml` file. One of the headers that you can override is `Cache-Control`. For more information, see [Setting custom headers for an Amplify app](custom-headers.md). | Yes | Yes | 
| Amplify respects the `Cache-Control` headers that you define in a `customHeaders.yaml` file and they take precedence over Amplify's default cache settings. | Yes | Yes | 
| Amplify respects the `Cache-Control` headers set within an application’s framework for dynamic routes (for example, Next.js SSR routes). If a `Cache-Control` header is set in the app's `customHeaders.yaml` file, this takes precedence over settings in the `next.config.js` file. | Yes | Yes | 
| Each new CI/CD app deployment clears the cache. | Yes | Yes | 
| You can turn on performance mode for an app. | Yes | No<br />The performance mode setting is no longer available in the Amplify console. However, you can create a `Cache-Control` header that sets the `s-maxage` directive. For instructions, see [Using the Cache-Control header to increase app performance](Using-headers-to-control-cache-duration.md). | 

The following table lists the changes to the default values for specific cache settings.


| Cache setting | Previous default value | Default value with caching improvements | 
| --- | --- | --- | 
| Cache duration for static assets | Two seconds | One year | 
| Cache duration for reverse proxy responses | Two seconds | Zero seconds (no caching) | 
| Max Time to Live (TTL) | Ten minutes | One year | 

For more information about how Amplify determines the caching configuration to apply to an application and instructions on managing cache key configuration, see the following topics.

**Topics**
+ [How Amplify applies cache configuration to an app](cache-configuration-type.md)
+ [Managing cache key cookies](cache-key-cookies.md)
+ [Using the Cache-Control header to increase app performance](Using-headers-to-control-cache-duration.md)