examples
examples copied to clipboard
add example for pooling browsers
this is an example for pooling browsers resulting in faster load times of pages since we not don't have to open new browser for each request . This results in improve load times especially in case of SPAs since cached resources can be reused.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here (e.g. I signed it!
) and we'll verify it.
What to do if you already signed the CLA
Individual signers
- It's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
Corporate signers
- Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the Google project maintainer to go/cla#troubleshoot (Public version).
- The email used to register you as an authorized contributor must be the email used for the Git commit. Check your existing CLA data and verify that your email is set on your git commits.
- The email used to register you as an authorized contributor must also be attached to your GitHub account.
CLAs look good, thanks!
I signed it.
This fixes #14
Is it possible to add a few more examples to the demo that helps show why a pool is necessary in some cases. Otherwise it's easy just to use the same browser instance to open 2 tabs for the URLs you're using.
The reason we are parallelizing work through browsers and not pages is because one page crash might bring down the whole browser and also each page isn't guaranteed to be totally clean (cookies and storage might bleed-through as seen here).
But that is unlikely :) The other one is a big in chrome that hopefully gets fixed soon.
I'd prefer to encourage folks to use separate browser instances only when it makes sense. It comes with much more overhead than launching a single instance. Having a demo that shows when/why you'd need to go with many instances would be more helpful IMO.
On Thu, Aug 23, 2018, 10:40 PM Rahul Kumar [email protected] wrote:
The reason we are parallelizing work through browsers and not pages is because one page crash might bring down the whole browser and also each page isn't guaranteed to be totally clean (cookies and storage might bleed-through as seen here https://bugs.chromium.org/p/chromium/issues/detail?id=754576).
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/GoogleChromeLabs/puppeteer-examples/pull/14#issuecomment-415656846, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOigNgNRi0CBOgBxvKXxhW1e54Lpzaoks5uT5HQgaJpZM4WD4pV .
i have used single browser in production and it was not stable over long periods of time maybe because i was using --single process flag. Even browserless.io recommends running multiple browsers opposed to running multiple pages
I'm not arguing the benefits for certain use cases. I'm saying we should have a demo that shows a case where you would want to do pooling.
On Mon, Aug 27, 2018, 2:36 AM Rahul Kumar [email protected] wrote:
i have used single browser in production and it was not stable over long periods of time maybe because i was using --single process flag. Even browserless.io https://docs.browserless.io/blog/2018/06/04/puppeteer-best-practices.html recommends running multiple browsers opposed to running multiple pages
I'm confused because this is an argument against keeping a pool of long running browsers open....
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/GoogleChromeLabs/puppeteer-examples/pull/14#issuecomment-416172041, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOigJeh0Q54JCtldEvyBbZbs6FyvoDpks5uU72xgaJpZM4WD4pV .
Ok i will add it