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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Cache request connection

Post Reply
Haku
Posts: 12
Joined: Sat Jan 29, 2022 10:33 pm

Cache request connection

Post by Haku »

How to disable the cache connection on the request? I see that the second request does'nt reload connection just uses active session. In wireshark i see only 1 Client Hello and Server Hello. But the request function does'nt destroy the connection.
Haku
Posts: 12
Joined: Sat Jan 29, 2022 10:33 pm

Re: Cache request connection

Post by Haku »

I use ICefRequest
User avatar
salvadordf
Posts: 4580
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Cache request connection

Post by salvadordf »

Hi,

Try setting the ICefRequest flags.

UR_FLAG_DISABLE_CACHE or UR_FLAG_SKIP_CACHE might be what you're looking for.
Haku
Posts: 12
Joined: Sat Jan 29, 2022 10:33 pm

Re: Cache request connection

Post by Haku »

Doesn't work. Connection still alive
User avatar
salvadordf
Posts: 4580
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Cache request connection

Post by salvadordf »

If I understand you correctly you would like to make independent requests.

If that's the case you need to create each browser with a new request context and a different cache directory. Those browsers will be completely independent.

See the MDIBrowser demo for all the details :
https://github.com/salvadordf/CEF4Delphi/blob/d93927b5c8a2926a9b31fd7d821a683693650397/demos/Delphi_VCL/MDIBrowser/uChildForm.pas#L203
Haku
Posts: 12
Joined: Sat Jan 29, 2022 10:33 pm

Re: Cache request connection

Post by Haku »

No i use CEFUrlRequestClientComponent and i see how after 1 request the connection is still alive and sometimes sends keep-alive tcp requests. I would like to destroy connection
User avatar
salvadordf
Posts: 4580
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Cache request connection

Post by salvadordf »

Try creating a new request context and use it as a parameter in TCefUrlRequestRef.New
Haku
Posts: 12
Joined: Sat Jan 29, 2022 10:33 pm

Re: Cache request connection

Post by Haku »

The URLRequest example already uses TCefUrlRequestRef.New for requests and doesn't destroy the connection. A new request uses previous connect session from Client Hello
Post Reply