Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Relic Solution: Measuring Cached vs. Uncached Page Load Performance


#1

We can sometimes see questions from customers about differences in reported page load times, especially between Browser and Synthetics. If it’s the same page, why are the reported load times so different? It’s a great question, and to answer it, we need to share exactly how Synthetics goes about it.

How Synthetics Measures Page Load

Synthetics starts each run with a fresh container and a new instantiation of Chrome, making sure that nothing is cached, there are no cookies, etc. This means that the performance we monitor is a full complete page load with no client-side help to make it faster. This is good because we don’t risk masking a new performance issue behind a previously cached version of the page.

However, it can also be interesting for to understand the difference in page performance between a full fresh page load and a page load with the assistance of client-side caching. Think of this as ‘worst-case’ and ‘typical’ page load times. The easiest way to do this with Synthetics is simply to load the page twice and add a unique query param to each load to determine which is which. This way you get both the cached and uncached loads in the Synthetics UI as well as having a way to distinguish them in Insights.

Here’s a super simple example script:

$browser.get('http://www.newrelic.com?withCaching=false').then(function(){
  $browser.get('http://www.newrelic.com?withCaching=true');
});

And here’s what the results look like in the UI:

Uncached:

Cached:

How does this relate to Browser?

The most common situation is that the real users from whom you are collecting Browser data are repeat users. This means that they probably have some client side caching of your site already. Assuming this is the case, their page load times might look a little faster than the page load times you’re seeing out of Synthetics unless you’re using the technique described above. That’s ok, and it’s expected. The caching can really make a lot of difference on page performance.

If you’re using Browser as well as Synthetics it’s a fine strategy not to worry about monitoring page load times of cached pages synthetically and just see that data in Browser. If you’re not using Browser already then it’s probably worth playing around with the example above to make sure you understand both your cached and uncached load times.


Clear Cache Before Scripted Browser Run