All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

Workers, Browser Run - Increased Browser Rendering limits!

1y ago

Source

CloudflareWorkers, Browser Run - Increased Browser Rendering limits!cloudflare.com
Snippet from the RSS feed
Browser Rendering now supports 10 concurrent browser instances per account and 10 new instances per minute, up from the previous limits of 2. This allows you to launch more browser tasks from Cloudflare Workers . To manage concurrent browser sessions, you can use Queues or Workflows : JavaScript export default { async queue ( batch , env ) { for ( const message of batch . messages ) { const browser = await puppeteer . launch ( env . BROWSER ) ; const page = await browser . newPage () ; try { await page . goto ( message . url , { waitUntil : message . waitUntil , } ) ; // Process page... } finally { await browser . close () ; } } }, }; TypeScript interface QueueMessage { url : string ; waitUntil : number ; } export interface Env { BROWSER_QUEUE : Queue < QueueMessage >; BROWSER : Fetcher ; } export default { async queue ( batch : MessageBatch < QueueMessage >, env : Env ) : Promise < void > { for ( const message of batch . messages ) { const browser = await puppeteer . launch ( env . BROWSER ) ; const page = await browser . newPage () ; try { await page . goto ( message . url , { waitUntil : message . waitUntil , } ) ; // Process page... } finally { await browser . close () ; } } }, }

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.