Giter VIP home page Giter VIP logo

Comments (2)

salvadordf avatar salvadordf commented on June 27, 2024 1

Hi,

If GlobalCEFApp.Cache and GlobalCEFApp.RootCache are empty then the default platform-specific directory will be used :

  1. "~/.config/cef_user_data" directory on Linux.
  2. "~/Library/Application Support/CEF/User Data" directory on MacOS.
  3. "AppData\Local\CEF\User Data" directory under the user profile directory on Windows.

Use of the default directory is not recommended in production applications. Multiple application instances writing to the same GlobalCEFApp.RootCache directory could result in data corruption.

If several instances of the same application run in incognito mode then they are sharing the default directory and that may cause data corruption.

Old CEF versions didn't have any lock to prevent data corruption but that is fixed since CEF 120.
DCEF used a very old CEF version and it was affected by this issue.

Unless you modify CEF sources there's no way to disable the lock and it's recommended to adapt the application code to use different GlobalCEFApp.RootCache values in order to avoid data corruption.

The linked forum thread has several solutions for this. In my opinion, keeping one app instance running all the time and opening new tabs or child forms with independent web browsers would be the best solution (see the MDIBrowser demo). Alternatively you can use custom RootCache directories for each instance. For example: "c:\root-PID" and delete unused RootCache directories periodically.

c:\root-PID can be calculated with "c:\root-" + the process ID in Windows.

from cef4delphi.

EricGrange avatar EricGrange commented on June 27, 2024

Thanks, I was under the impression that incognito mode kept everything in memory (and wrote nothing to disk), but if it's just falling back to a default directory, then segregating RootCache is probably best (different apps have different CEF settings, so reusing the same might be problematic, some are using off-screen non-GPU rendering, while others are interactive for instance)

from cef4delphi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.