Search code examples
ruby-on-railsnewrelic

New Relic Javascript w/ HTTP Caching


I'm working on implementing HTTP caching in my application, but noticed that the Javascript that the New Relic gem puts at the end of the page changes for every request. It looks like it might be some sort of time stamp.

Here's one example:

NREUMQ.push(["nrfj","beacon-3.newrelic.com","aff3157301","1021194","dl4IQBBfX1tcF01fRVBcFRsBUUdSXgoQTw==",1,2709,new Date().getTime(),"","","","",""]);

And a second:

NREUMQ.push(["nrfj","beacon-3.newrelic.com","aff3157301","1021194","dl4IQBBfX1tcF01fRVBcFRsBUUdSXgoQTw==",4,2514,new Date().getTime(),"","","","",""]);

Would clients using a cached version of this page cause inaccuracies in New Relic's reporting?


Solution

  • I reached out to New Relic support and they provided this response:

    A cached page will contain stale (previously generated) application and queue times in its RUM footer. New Relic can detect cached pages by comparing the total backend time against app and queue time. When the sum of app and queue time is greater than the total backend time, New Relic assumes the page was cached and aggregates the request with app and queue times as zero.