Bug 1751283 - Compute age from timestamp for Telemetry r=gbeckley

Differential Revision: https://phabricator.services.mozilla.com/D136536
This commit is contained in:
Mathieu Leplatre 2022-01-27 08:22:56 +00:00
parent db24c6826c
commit 76afa0f737
2 changed files with 1 additions and 3 deletions

View File

@ -338,8 +338,7 @@ var Utils = {
serverTimeMillis += cacheAgeSeconds * 1000;
// Age of data (time between publication and now).
let lastModifiedMillis = Date.parse(response.headers.get("Last-Modified"));
const ageSeconds = (serverTimeMillis - lastModifiedMillis) / 1000;
const ageSeconds = (serverTimeMillis - timestamp) / 1000;
// Check if the server asked the clients to back off.
let backoffSeconds;

View File

@ -64,7 +64,6 @@ function serveChangesEntries(serverTime, entries) {
const latest = entries[0]?.last_modified ?? 42;
if (entries.length) {
response.setHeader("ETag", `"${latest}"`);
response.setHeader("Last-Modified", new Date(latest).toGMTString());
}
response.write(JSON.stringify({ timestamp: latest, changes: entries }));
};