addyosmani / addyosmani/critical

Resource Utilization

Offen
#589 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
10.3k
Forks
390
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Dear maintainers,

I would like to clarify, maybe, a simple question. For context, we have a container dedicated on running critical to extract css from pages running on a k8s pod behind a HTTP server, I would like to know if every time that a requests arrives does it spin up another window or use the same window open, using the base implementation of critical? We've been seen that the container is consuming all the available resources, the scenario is for tens of thousand requests per minute. Is there any docs on how critical manages penthouse therefore manages puppeteer in headless mode ?

```ts
async function getBrowser() {
return puppeteer.launch({
args: ['--no-sandbox', '--disable-dev-shm-usage'],
executablePath: '/usr/bin/chromium',
headless: true,
})
}
```

```ts
const { css } = await critical.generate({
html,
width,
height,
request: {
method: 'get',
},
penthouse: {
puppeteer: {
getBrowser,
},
blockJSRequests: false,
},
...
```

Best,

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.