Page 1 of 1

Fastest way to load a new page

Posted: Sat Sep 11, 2021 12:19 pm
by Det20
Hello,

i use CEF4Delphi to check some sites. Therefor i use 6 x Chromium and load a page into each instance. Next time i search the next free Chromium and load the next page by call .LoadURL. Problem: If the site is loaded, it takes some times before .LoadURL loads the next one. I try to navigate to "about:blank" first, but this doesn't solve my problem.

So, is this "by design" or is there another fast way to Load another URL? I try CloseBrowser/CreateBrowser but this doesn't work (GPF).

Best

Re: Fastest way to load a new page

Posted: Sun Sep 12, 2021 9:00 am
by salvadordf
Hi,

You can try to destroy the browser following the destruction steps while you use a new one to load the next URL. Perhaps having an unused browser in the background can help you speed up this process.

However, the cause of this delay may be in Chromium's code. I guess it takes some time to create a new render process because the URL is different.

You can also try other "Process models" :
http://www.chromium.org/developers/design-documents/process-models
http://www.chromium.org/Home/chromium-security/site-isolation

...but CEF only supports the default process model and any issue you may have will not be fixed by CEF.

Some other people used this switch to increase the maximum number of renderer processes but Im not sure if it still works :

Code: Select all

--renderer-process-limit
You can test it by adding this line before the GlobalCEFApp.StartMainProcess call in the DPR file :

Code: Select all

GlobalCEFApp.AddCustomCommandLine('--renderer-process-limit', '100');

Re: Fastest way to load a new page

Posted: Mon Sep 13, 2021 10:27 am
by Det20
Thank you, i try booth and it works. But, if i call "CloseBrowser", my app closes if i handle "if application.terminated".

Re: Fastest way to load a new page

Posted: Mon Sep 13, 2021 10:30 am
by salvadordf
Use the code in the TabbedBrowser2 demo to open and close browser tabs without closing the whole app.

Re: Fastest way to load a new page

Posted: Tue Sep 14, 2021 3:22 pm
by Det20
Thank you very much, now it works perfekt!