checked with the team: They can use `keep_alive` , eg `const browser = await puppeteer.launch(env.M

checked with the team:

They can use keep_alive , eg const browser = await puppeteer.launch(env.MYBROWSER, { keep_alive: 600000 }); to keep the browser alive for 10 minutes, and then, in order to get a valid sessionId, they need to call https://developers.cloudflare.com/browser-rendering/platform/puppeteer/#list-open-sessions .

Full example here https://developers.cloudflare.com/browser-rendering/workers-bindings/reuse-sessions/#4-code
Cloudflare Docs
The best way to improve the performance of your browser rendering Worker is to reuse sessions. One way to do that is via Durable Objects, which allows you to keep a long running connection from a Worker to a browser. Another way is to keep the browser open after you've finished with it, and connect to that session each time you have a new request.
Was this page helpful?