Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Fastest way to load a new page

Post Reply
Det20
Posts: 38
Joined: Fri Mar 10, 2017 3:11 pm

Fastest way to load a new page

Post 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
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Fastest way to load a new page

Post 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');
Det20
Posts: 38
Joined: Fri Mar 10, 2017 3:11 pm

Re: Fastest way to load a new page

Post by Det20 »

Thank you, i try booth and it works. But, if i call "CloseBrowser", my app closes if i handle "if application.terminated".
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Fastest way to load a new page

Post by salvadordf »

Use the code in the TabbedBrowser2 demo to open and close browser tabs without closing the whole app.
Det20
Posts: 38
Joined: Fri Mar 10, 2017 3:11 pm

Re: Fastest way to load a new page

Post by Det20 »

Thank you very much, now it works perfekt!
Post Reply