Sha256: 397b20dd4ac933b3a8d6bf246637b549f18dd637182d0b100630452e847c06ac

Contents?: true

Size: 715 Bytes

Versions: 7

Compression:

Stored size: 715 Bytes

Contents

(function () {
  /* global LUX, performance */
  if (typeof LUX === 'undefined') { return }

  const navigationPerformance = performance.getEntriesByType('navigation')[0]
  if (!navigationPerformance) { return }

  // As per RFC 147[1], this adds in monitoring of the type of HTTP protocol that
  // is used when a browser loads a page.
  // [1]: https://github.com/alphagov/govuk-rfcs/pull/148
  LUX.addData('http-protocol', navigationPerformance.nextHopProtocol)

  const serverTiming = navigationPerformance.serverTiming
  if (serverTiming) {
    const cacheState = serverTiming.find(entry => ['cacheHit', 'cacheMiss'].includes(entry.name))
    if (cacheState) { LUX.addData('cache', cacheState.name) }
  }
}())

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
govuk_publishing_components-51.1.0 app/assets/javascripts/govuk_publishing_components/rum-custom-data.js
govuk_publishing_components-51.0.0 app/assets/javascripts/govuk_publishing_components/rum-custom-data.js
govuk_publishing_components-50.0.1 app/assets/javascripts/govuk_publishing_components/rum-custom-data.js
govuk_publishing_components-50.0.0 app/assets/javascripts/govuk_publishing_components/rum-custom-data.js
govuk_publishing_components-49.1.0 app/assets/javascripts/govuk_publishing_components/rum-custom-data.js
govuk_publishing_components-49.0.0 app/assets/javascripts/govuk_publishing_components/rum-custom-data.js
govuk_publishing_components-48.0.0 app/assets/javascripts/govuk_publishing_components/rum-custom-data.js