gpt4 book ai didi

c# - EO WebBrowser 页面缓存问题

转载 作者:太空狗 更新时间:2023-10-30 01:33:02 26 4
gpt4 key购买 nike

我在窗口内使用 EO webView 来加载 HTML 页面。即使我在页面中使用以下内容,页面似乎也会缓存。如何确保每次加载页面时都进行硬刷新?

我在 Windows 窗体中为“PageRefresh”添加了一个上下文菜单项,因此它会在选择菜单项时运行 CommandIds.ReloadNoCache。我如何做到在页面加载时发生。

    <meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

我有以下代码来添加一个菜单项来执行 PageRefresh,它工作正常,但我希望它在用户触发菜单项时发生。

private void WebView_BeforeContextMenu(object sender, BeforeContextMenuEventArgs e)
{
e.Menu.Items.Clear();

e.Menu.Items.Add(new EO.WebBrowser.MenuItem("ViewSource", CommandIds.ViewSource));

e.Menu.Items.Add(new EO.WebBrowser.MenuItem("PageRefresh", CommandIds.ReloadNoCache));

}

最佳答案

引自EO admin response

In the current version the only way to clear cache is seems to delete the EO.WebBrowser.Runtime.CachePath directory. You will need to close all WebView instances in order to do so. In the future we will add some interface for you to clear cache programmatically without having to shutdown all WebViews.

关于c# - EO WebBrowser 页面缓存问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35227516/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com