Monday, January 29, 2024

Optimizing Static File Performance: Implementing Caching and Compression with Azure Front Door

Azure Front Door is a global CDN service that enables you to securely expose your web artifacts to the external world. In this short article, I will demonstrate the process of caching and compressing responses by leveraging the caching and compression features provided by Azure Front Door.

It is advisable to apply caching and compression to static files such as CSS, images, JSON files, CSV, etc., as opposed to dynamic content. Therefore, careful route planning is imperative before embarking on the implementation of caching and compression strategies.

Following is an example.

  • route 1 - /api/*
  • route 2 -/assets/*
Following the example mentioned above, we'll designate the /api route for dynamic API content and the /assets route for static content. Let's proceed with the implementation. Let's focus on /assets route.

Let's start by navigating to the Front Door manager and selecting the desired endpoint.

Click on "Add a route" to begin configuring the routes for your Front Door setup.

















Next, specify the path of the route to match











Let's explore how to define cache and compression settings.









I prefer selecting the Use Query String option, as it allows Front Door to independently cache responses with query strings. However, there are other options available for you to choose from.

This completes the necessary steps to optimize your responses for static content.

Tuesday, January 9, 2024

Investigate the root cause for latency with Azure Application Insights

In this article, I will demonstrate how to pinpoint the root cause when end users experience general latency. Azure Monitor - Application Insights will be instrumental in this process.

Firstly, we need to navigate to the Performance blade of the Application Insights instance.
















Following that, it's better apply filters to refine the dataset.








As we aim to identify the lowest performance, it is advisable to conduct the investigation using the 99th percentile.










There is a distinct outlier present. Let's delve deeper into the investigation by narrowing down the time range to examine specific instances of the failure.




















The DELTA indicates the extent to which the selected data points differ from the rest of the transactions within the chosen timeframe.

The Insights tile lets you identify the specific method, representing the best possible cause, that contributes to the majority of the latency, as illustrated below.

















Utilize the Distribution of Durations tile to narrow down and select the incidents with the least performance. Check samples for further analysis.























This analysis is very important in pinpointing the root cause of latency and facilitating the implementation of necessary corrective actions.