Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Jun 12, 2023
1 parent f1ee670 commit 183454c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
10 changes: 2 additions & 8 deletions core/audits/server-response-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ const UIStrings = {
description: 'Keep the server response time for the main document short because all other requests depend on it. [Learn more about the Time to First Byte metric](https://developer.chrome.com/docs/lighthouse/performance/time-to-first-byte/).',
/** Used to summarize the total Server Response Time duration for the primary HTML response. The `{timeInMs}` placeholder will be replaced with the time duration, shown in milliseconds (e.g. 210 ms) */
displayValue: `Root document took {timeInMs, number, milliseconds}\xa0ms`,
/** A message displayed in a Lighthouse audit result warning that the server response time could not be determined. */
missingTimingWarning: 'Missing timing information needed to determine the server response time',
};

const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
Expand Down Expand Up @@ -49,7 +47,7 @@ class ServerResponseTime extends Audit {
*/
static calculateResponseTime(record) {
// Lightrider does not have timings for sendEnd, but we do have this timing which should be
// close.
// close to the response time.
if (global.isLightrider && record.lrStatistics) return record.lrStatistics.requestMs;

if (!record.timing) return null;
Expand All @@ -69,11 +67,7 @@ class ServerResponseTime extends Audit {

const responseTime = ServerResponseTime.calculateResponseTime(mainResource);
if (responseTime === null) {
return {
score: 0,
runWarnings: [str_(UIStrings.missingTimingWarning)],
notApplicable: true,
};
throw new Error('no timing found for main resource');
}

const passed = responseTime < TOO_SLOW_THRESHOLD_MS;
Expand Down
3 changes: 0 additions & 3 deletions shared/localization/locales/en-US.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions shared/localization/locales/en-XL.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 183454c

Please sign in to comment.