We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66dd5aa commit 2731e57Copy full SHA for 2731e57
src/generate-critical-css.ts
@@ -153,7 +153,9 @@ export async function generateCriticalCSS( {
153
successRatio?: number;
154
maxPages?: number;
155
} ): Promise< [ string, Error[] ] > {
156
- const successUrlsThreshold = Math.ceil( urls.length * successRatio );
+ // Success threshold is calculated based on the success ratio of "the number of URLs provided", or "maxPages" whichever is lower.
157
+ // See 268-gh-Automattic/boost-cloud
158
+ const successUrlsThreshold = Math.ceil( Math.min( urls.length, maxPages ) * successRatio );
159
160
try {
161
progressCallback = progressCallback || noop;
0 commit comments