Is CEF cache persistent between sessions ?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Is CEF cache persistent between sessions ?

Postby aligre » Thu Jul 13, 2023 11:35 am

Hello

My configuration :
CEF version : 114
Os version : windows 10
The CEF cache path is set and always same.

Some tests I've made seem to show that queries are found in the cach if they comes from the same CefClient.
Then two different CefClients, in the same session or from two successive sessions, don't share queries responses.

This is also what I understand from the comments about cef_settings_t.cache_path :
HTML5 databases such as localStorage will only persist across sessions if a cache path is specified


Am I right, the queries responses are not persistenly cached ?
I hope I'm wrong ...

Regards,
Julien
aligre
Techie
 
Posts: 24
Joined: Fri Apr 09, 2021 7:38 am

Re: Is CEF cache persistent between sessions ?

Postby magreenblatt » Thu Jul 13, 2023 7:00 pm

A single cache directory can only be used by a single main process. Do not use the same cache directory for multiple processes at the same time.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Is CEF cache persistent between sessions ?

Postby HarmlessDave » Fri Jul 14, 2023 7:26 pm

To add a little, if you enforce a single instance of the main CEF process running at a time (only one "app" with its browser, renderer, plugin, ... processes) then yes, the cache is persistent as long as you keep using the same cache folder. Local storage works properly too.

If you need to run multiple "apps" (multiple main browser processes) then you must give each one its own cache folder, and so changes one makes to its cache folder will not apply to any other cache folder.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Is CEF cache persistent between sessions ?

Postby aligre » Sun Jul 16, 2023 1:48 pm

Hello

thanks both of you for the answsers.
Yes, we use a different cache directories for each main browser processes.

I thinks I've found the cause of non-cached responses in our scenario, it's because the server add the following header that I didnt know
vary: Accept-Encoding,Origin,Referer

and the requests doesnt have the same Referer in their headers

I was surprised by what I saw in fiddler and naively I thaught there was an issue in CEF cache management.
Thanks to your answers, I've focused on the queries content and found the right cause.

Thanks
aligre
Techie
 
Posts: 24
Joined: Fri Apr 09, 2021 7:38 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 203 guests