ClearCache in Ram
Posted: Sun May 07, 2023 3:42 pm
Hi, as I understand it, "Network.clearBrowserCache" clears only what is on the disk, but how to completely clean it?
Experimentally found such a way out, but how much is it true? If you observe in devtools that with a similar approach, nothing loads from the ram cache anymore.
This can be achieved manually in devtools, check the "disable cache" box, then clean the cache and uncheck the disable box.
Experimentally found such a way out, but how much is it true? If you observe in devtools that with a similar approach, nothing loads from the ram cache anymore.
Code: Select all
Chromium1.ExecuteDevToolsMethod(0, 'Network.enable', nil);
TempParams := TCefDictionaryValueRef.New;
TempParams.SetBool('cacheDisabled', True);
Chromium1.ExecuteDevToolsMethod(0, 'Network.setCacheDisabled', TempParams);
Chromium1.ClearDataForOrigin('');
Chromium1.ClearCache;
TempParams := TCefDictionaryValueRef.New;
TempParams.SetBool('cacheDisabled', False);
Chromium1.ExecuteDevToolsMethod(0, 'Network.setCacheDisabled', TempParams);
Chromium1.ExecuteDevToolsMethod(0, 'Network.disable', nil);