It seems New Relic will soon stop using an unload event listener. This prevented pages to benefit from the ultra-fast back/forward cache.

They shipped an experimental setting last month: https://docs.newrelic.com/docs/release-notes/new-relic-browser-release-notes/browser-agent-release-notes/browser-agent-v1222/

And they're about to make it the default: https://github.com/newrelic/newrelic-browser-agent/pull/401

Yeah for faster websites!

Browser agent v1222 | New Relic Documentation

Browser agent v1222

@anthony That's correct, we're currently testing the feature internally, looks good so far; bfcache no longer blocked (after years of blocking it in their support forum).

What worries me is the overall JS parse size increase:
12 months ago it was 31 kB of blocking JS for the loader, plus 46 kB for the full-featured SPA tracking (total: 78 kB). Today it's 66 kB for the blocking loader plus 11 files weighing 67 kB (total 133 kB). That's +70 % JS year-over-year. (measured in current Chrome 110)

@anthony Along the way they even dropped support for pre-ES6 browsers, but the weight keeps creeping up.

Looks like they introduced Webpack bundling. It's sad that once again more frontend tooling leads to more JavaScript. I really hope they benefit from the claimed "improved DX"...

@quotingeddie Oh that's unfortunate that the loader has more than doubled in size.

I would suggest opening an issue on their repo to ask to set a budget for the loader. With the information you shared here, they should be willing to set one.

And once that budget is set, they could explore webpack settings or other bundlers to reduce that size.

@anthony I've already contacted the support, they're looking into it. And, in fact, some of my addressed concerns are already fixed in the current version (e.g. before they included code for IE 6-9).
But yeah, maybe it makes sense to increase visibility in the public repo, good idea.

@quotingeddie Its not just visibility, it’s also a direct conversation with engineers. Less risk of your ask being misunderstood.

Let me know when you’ve filed an issue so I can subscribe.

@anthony This is the GitHub issue: https://github.com/newrelic/newrelic-browser-agent/issues/492. After long waits in their Jira (which is now not public anymore) I turned to GitHub, without much success.
Bundle size increases significantly · Issue #492 · newrelic/newrelic-browser-agent

Description We noticed that the bundle size of the loader keeps increasing. Comparing version 1214 to 1222: v1214: 31 kB (loader) + 46 kB (nr-spa-x.min.js) = 78 kB v1222: 52 kB (loader) + 10 files ...

GitHub

@anthony

> We target and test support for just the last ten versions of Chrome, Edge, Safari, and Firefox

The last ten versions of Safari?! What is that, 2012? 😆

@simevidas What is a version ? Are 16.0, 16.1, 16.2 one or three versions?
@anthony If that’s the case, then last 10 versions goes only to 15.0. That would be a problem because a significant number of mobile requests are coming from Safari 14 and older (1.7% in total https://analytics.wikimedia.org/dashboards/browsers/#mobile-site-by-browser/browser-family-and-major-hierarchical-view)
Dashiki: Simple Request Breakdowns

@simevidas Sorry my answer was missing an indicator of sarcasm.

I meant that New Relic's docs are not clear enough with that statement. And the linked pages are not helpful either.