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.

CEF4Delphi (TChromium) cache

Post Reply
Pcrepair
Posts: 10
Joined: Tue Sep 27, 2022 5:09 pm

CEF4Delphi (TChromium) cache

Post by Pcrepair »

Good day salvadordf

When the browser runs in the directory cache/Cache/Cache_Data (store pages) and in the directory cache/Code Cache (store JavaScript) a lot of unnecessary files accumulate. I can just delete them manually. but it is better that they do not accumulate there.

If this is possible, please give me some hints on how to disable the cache (the right way).

Thank you.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: CEF4Delphi (TChromium) cache

Post by salvadordf »

Hi,

Add this code line before the GlobalCEFApp.StartMainProcess in the DPR file :

Code: Select all

GlobalCEFApp.cache := '';
This setting will use RAM for the cache.

If you prefer to clear the cache at runtime then call TChromiumCore.ClearCache but this will reduce the file sizes (not delete the files)

If you prefer to delete the old cache files before initializing CEf then you can add this code line before the GlobalCEFApp.StartMainProcess in the DPR file :

Code: Select all

GlobalCEFApp.DeleteCache := True;
Post Reply