Content delivery networks (CDNs) reduce latency by delivering cached data (e.g., JavaScript files, stylesheets, images, and videos) from a network of linked proxy servers to end users around the globe. CDNs help reduce the load on your origin servers and shorten the distance that data needs to travel, thus improving the end-user experience. Datadog Synthetic Monitoring now shows you which CDN providers are loading resources within your Synthetic tests, along with their cache status, so you can easily determine whether outdated CDN caches are causing problems in your Synthetic tests. You can also use this insight to further improve your end-user experience by adding more CDN coverage where needed.
In this post, we’ll show you how to leverage CDN visibility to troubleshoot slow tests and give you a high-level overview of CDN optimization.
Leverage CDN visibility to troubleshoot slow tests
Let’s walk through an example of how you can use CDN visibility to troubleshoot slow Synthetic tests. Say you are using a suite of Synthetic tests to verify the performance of the checkout process on your e-commerce site. The store’s origin server is located in Europe, and a CDN speeds up load times by relaying data from the origin server to users in a U.S. location. One step of a Synthetic test is sporadically experiencing high latency.
The Resources tab displays the list of CDN providers used for each browser test execution along with a summary of cache hits and misses. In this case, you discover that a request for a JavaScript file hosted by a CDN is taking a long time to load.
For comparison, you check a previous Synthetic test and find that the same resource loaded quickly in that case. You check your latest commits and verify that you did not update the resource between tests. From this, you can conclude that the CDN’s slow response is causing the latency in this test. You can click on the CDN icon to see the cache status, helping you understand why this step in the test execution is taking so long.
In this case, the request to the CDN was a miss, meaning the cached content was not used. A miss can occur for several reasons, including an expired cache. To confirm that the time to live (TTL) was the cause of the miss, check the Minimum TTL for this resource’s cache key in your CloudFront distribution. If you discover that an expired cache was the cause of the miss, you may want to increase the TTL by reconfiguring your distribution’s cache policy. This can help reduce the likelihood of a miss in the future.
CDN visibility allows you to quickly see if a CDN miss is at the root of a slow Synthetic test. This can help you pinpoint a source of latency that otherwise would have been invisible, reduce MTTR, and prevent slow-loading resources from degrading your end-user experience.
CDN optimization
Datadog integrates with a number of CDN providers, such as: Akamai, Cloudflare, Fastly, Amazon CloudFront, and more. By understanding how these CDNs are utilized within your HTTP-based Synthetic tests (API, multistep, and browser tests), you can get the insight needed to improve your end-user experience.
You can see a high-level view of all the CDN providers involved in any particular Synthetic test, quickly identify which resources were served by a CDN, and determine if there are any other resources that could benefit from using a CDN to improve performance.
For even more context around the role of CDNs in your applications, you can also view out-of-the-box dashboards of key metrics and logs from each provider, as shown below.
If you use multiple CDNs, this new visibility will help you determine which ones are problematic so you can contact the right support team and/or investigate if you should change your CDN configuration.
Monitor CDNs used in your Synthetic tests
CDN visibility is now available in Synthetic Monitoring, making it easy to identify which resources are served by a CDN and whether any CDNs are responsible for slow Synthetic tests. If you’re using Datadog but haven’t started using Synthetic Monitoring, now is a great time to create your first Synthetic test. And if you’re new to Datadog, sign up for a 14-day free trial.