diff --git a/services/web/frontend/js/ide/pdf/controllers/PdfJsMetrics.js b/services/web/frontend/js/ide/pdf/controllers/PdfJsMetrics.js index b3c3d3b203..469db5ebe0 100644 --- a/services/web/frontend/js/ide/pdf/controllers/PdfJsMetrics.js +++ b/services/web/frontend/js/ide/pdf/controllers/PdfJsMetrics.js @@ -1,7 +1,13 @@ import { v4 as uuid } from 'uuid' import { sendMB } from '../../../infrastructure/event-tracking' +// VERSION should get incremented when making changes to caching behavior or +// adjusting metrics collection. +// Keep in sync with the service worker. +const VERSION = 2 + const pdfJsMetrics = { + version: VERSION, id: uuid(), epoch: Date.now(), totalBandwidth: 0, diff --git a/services/web/frontend/js/serviceWorker.js b/services/web/frontend/js/serviceWorker.js index ac048ed0bd..57fa7c88d0 100644 --- a/services/web/frontend/js/serviceWorker.js +++ b/services/web/frontend/js/serviceWorker.js @@ -3,6 +3,7 @@ const OError = require('@overleaf/o-error') // VERSION should get incremented when making changes to caching behavior or // adjusting metrics collection. +// Keep in sync with PdfJsMetrics. const VERSION = 2 const CLEAR_CACHE_REQUEST_MATCHER = /^\/project\/[0-9a-f]{24}\/output$/