---
title: Lab part 4: Debug frontend slowness in your application
source: https://docs.newrelic.com/docs/browser/new-relic-browser/lab/debug-slowness
---

> #### 💡 LAB
>
> This procedure is part of a lab that teaches you how to troubleshoot your web app with New Relic browser monitoring.
>
> Each procedure in the lab builds upon the last, so make sure you've completed the last procedure, [_Debug errors in your application_](https://docs.newrelic.com/docs/browser/new-relic-browser/lab/debug-errors), before starting this one.

After fixing JavaScript errors in your application, you and your team are feeling confident. Ready for your down time, you head over to social media but you check Twitter and see some confused customers:

![unhappy customers](https://docs.newrelic.com/images/browser-lab-screenshot-tweet.webp "unhappy customers")

Uh oh! You customers don't look happy. It's time to use New Relic browser monitoring to discover the source of delay.

> #### ⚠️ IMPORTANT
>
> In order to see your data in New Relic, you need to enable browser monitoring for this procedure.
>
> If you haven't already, [instrument your app with our browser agent](https://docs.newrelic.com/docs/browser/new-relic-browser/lab/install-browser-agent).

## Debug slowness in your application

1.  From the New Relic homepage, navigate to **Browser** and choose your **Relicstaurants** application.
    ![view relicstaurants](https://docs.newrelic.com/images/browser-lab-screenshot-view-relicstaurants.webp "view relicstaurants")
2.  Here, you see all the data related to your browser application including **Page views with JavaScript errors**, **Core web vitals**, **User time on the site**, **Initial page load and route changes**, and others.
    ![Relicstaurants summary](https://docs.newrelic.com/images/browser-lab-screenshot-relicstaurants-browser-app.webp "Relicstaurants summary")
    Notice the **largest contentful paint (LCP)**.
    ![LCP](https://docs.newrelic.com/images/browser-lab-screenshot-LCP.webp "LCP")
    Largest contentful paint (LCP) represents how quickly the main content of a web page is loaded. Ideally, the content should not take more than a second or two to load.
    Here, you see that your site is loading in more than 5 seconds. No wonder your users are complaining!
    But what's causing this delay? back end?
3.  Scroll down and notice the **Front end vs. back end** graph.
    ![frontend vs backend graph](https://docs.newrelic.com/images/browser-lab-screenshot-frontend-vs-backend.webp "frontend vs backend graph")
    Click on **Back end (time to first byte) (50%)** to filter the graph and see how long backend takes to load.
    ![backend time consumption](https://docs.newrelic.com/images/browser-lab-screenshot-backend.webp "backend time consumption")
    The graph indicates that the back end took maximum 140 milliseconds to process the request in worst case. Does this mean your front end is causing delay?
    Click on **Front end (Window load + AJAX) (50%)**.
    ![frontend time consumption](https://docs.newrelic.com/images/browser-lab-screenshot-frontend.webp "frontend time consumption")
    There's the problem! The graph indicates that the delay is happening on front end.
4.  To narrow down what might be causing the delat on front end, take a closer look at **Initial page load and route change** graph.
    ![page load graph](https://docs.newrelic.com/images/browser-lab-screenshot-page-load-graph.webp "page load graph")
5.  Click on **Initial page load (Window load + AJAX)**.
    ![initial page load](https://docs.newrelic.com/images/browser-lab-screenshot-initial-page-load.webp "initial page load")
    The graph indicates that **Initial page load (Window load + AJAX)** is taking 5-6 seconds which is alarming.
6.  Click **Initial page load and route change** to see more details.
    ![page load details](https://docs.newrelic.com/images/browser-lab-screenshot-page-load-detail.webp "page load details")
    This takes you to **Page views**.
    ![page views](https://docs.newrelic.com/images/browser-lab-screenshot-page-views.webp "page views")
7.  Sort the pages by **Most time-consuming**.
    ![sort page](https://docs.newrelic.com/images/browser-lab-screenshot-sort-pages.webp "sort page")
    Notice that the initial page is taking almost 90% of time to load.
    ![most time consuming pages](https://docs.newrelic.com/images/browser-lab-screenshot-most-time-consuming-page.webp "most time consuming pages")
    Click on it to view it's details.
    ![most time consuming page detail](https://docs.newrelic.com/images/browser-lab-screenshot-most-time-consuming-page-detail.webp "most time consuming page detail")
    This page shows you **Page view breakdown**, **Median initial page load time**, and other important details. **Page view breakdown** graph is especially important here since it helps you narrow down why and where your page is taking longer.
    Upon taking a closer look into this graph, you see that **Page rendering** is taking as long as 5000 miliseconds.
    ![page rendering](https://docs.newrelic.com/images/browser-lab-screenshot-page-rendering.webp "page rendering")
    You now know that initial page is taking quite long to render making your application slow. Next, we observe the **Session traces** to figure out what is slowing down the rendering process.
    Exit this view by clicking the **X** in the top right hand corner.
8.  From left hand navigation, navigate to **Session traces** and sort them in the decending order of **Page load**.
    ![most time consuming pages](https://docs.newrelic.com/images/browser-lab-screenshot-session-traces.webp "most time consuming pages")
9.  Here, you see the session traces sorted in the order of **Page load** time.
    ![sorted session traces](https://docs.newrelic.com/images/browser-lab-screenshot-sorted-session-traces.webp "sorted session traces")
10. From the list, click the first one.
    ![trace detail](https://docs.newrelic.com/images/browser-lab-screenshot-navigate-to-trace-detail.webp "navigate to trace detail")
    ![image showing sorted session traces](../../../images/nr-browser/navigate-to-trace-detail.webp)
    This takes you to **Session traces** detail page.
    Here, you see the complete trace for that particular session. This page also shows you **Backend**, **Dom Processing**, **Page Load**, and other trace related information.
    ![full trace](https://docs.newrelic.com/images/browser-lab-screenshot-trace.webp "full trace")
11. Note that **Page load** is taking longer than expected. You're need a detailed timeline of the load. Scroll the pointer on the left and right to adjust the timeline.
    ![adjust trace timeline](https://docs.newrelic.com/images/browser-lab-screenshot-adjust-timeline.webp "adjust trace timeline")
12. Scroll through the trace to move through the time window and see the details of individual events during this session.
    ![adjust time window](https://docs.newrelic.com/images/browser-lab-screenshot-trace-time-window-detail.webp "adjust time window")
13. Notice that a particular event is taking more than 5 seconds.
    ![image trace](https://docs.newrelic.com/images/browser-lab-screenshot-image-trace.webp "image trace")
14. Click on the event to see its details.
    ![image trace detail](https://docs.newrelic.com/images/browser-lab-screenshot-image-trace-detail.webp "image trace detail")
    Notice that it's an image. Particularly, it's the background image of your application which is taking 5 - 6 seconds to load and causing the delay.

Based on these findings, you hypothesize that the background image is the culprit here. High-resolution, unoptimized images are the most common reason behind the website slowness.
Good news! now that you know the reason, you can fix the problem.

## Summary

To recap, you observed slowness in your application and used New Relic browser monitoring to:

1.  Observe Core web vitals of your site
2.  Narrow down the sources of slowness

## Homework

Well done! Now that you've gotten a jump start with our monitoring, here are some docs that will help you take the next steps on your journey.

-   [Introduction to browser monitoring](https://docs.newrelic.com/docs/browser/browser-monitoring/getting-started/introduction-browser-monitoring/)
-   [Browser monitoring features](https://docs.newrelic.com/docs/browser/new-relic-browser/browser-pro-features/intro-to-browser-pro-features)
