2015-12-02 1448 views

回答

0

如果您没有提供CachePath那么将使用InMemory缓存,然后您可以随后设置cookie的路径。示例如下。

https://github.com/cefsharp/CefSharp/blob/cefsharp/45/CefSharp.Example/CefExample.cs#L134

对于Cache大小,如果你检查的缓存文件夹,你会看到类似的东西得到Fonts缓存,而且占用了大量的空间。所以你看到它的使用正常,没有什么可担心的。这将与Chrome的同等版本相当。

编辑:看样以下

Cef.OnContextInitialized = delegate 
{ 
    var cookieManager = Cef.GetGlobalCookieManager(); 
    cookieManager.SetStoragePath("cookies", true); 
}; 

Cef.Initialize(new CefSettings() 
{ 
    PersistSessionCookies = true, 
}); 
1

嗯,但在这种情况下,我有权利也指定cache_path? 我不明白如何将此代码合并到我的。 我只是这样做的:

 Cef.Initialize(new CefSettings() 
     { 
      PersistSessionCookies = true, 
      CachePath = "C:\\Cache" 
     }); 

我该如何合并该代码? 谢谢

+0

不,你可以在其他东西中使用InMemory缓存。 – amaitland