Office 加载项开发期间无法清除 Edge WebView 中的缓存
Can't clean cache in Edge WebView during Office Add-In Development
现在 Office 加载项使用新的基于 Edge 的 WebView 而不是基于 IE 11 的 WebView。从这一刻起,我无法发展任何东西。因为项目的所有文件都不能更改。 Edge WebView 始终使用它们的缓存版本。
我用了很多东西。
<!-- Cache Control-->
<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" />
<!-- No results. Absolutely. All content still cached-->
我也尝试了这里的所有方法:
Office-js addin with Excel and Edge Webview - how to delete cache?
同样没有成功。
现在我用两种3种方式进行"development"。
1. 在 Manifest.xml 中更改起点。每次改变一些东西。
2. 在文件*.csproj 和*.cproj.user 中更改解决方案Web 部分的端口。这也需要在每次尝试更改代码时完成。
3.每次更改后等待明天。是的,它有帮助。
我哪里错了?请帮忙!
更新:我刚刚了解到 WebView2。我敢肯定,在我的案例中我使用的是常用的 Edge WebView。
已更新Office-js addin with Excel and Edge Webview - how to delete cache?
在我们的示例中,我们使用 Azure App Service (IIS) 作为 Office 加载项的后端。
并且我们添加了以下 web.config 设置,让客户端在每次访问时重新验证所有缓存的文件:
...
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="0.00:00:00" cacheControlCustom="must-revalidate" />
</staticContent>
...
当然,cacheControlMaxAge可以根据您的需要进行调整。
现在 Office 加载项使用新的基于 Edge 的 WebView 而不是基于 IE 11 的 WebView。从这一刻起,我无法发展任何东西。因为项目的所有文件都不能更改。 Edge WebView 始终使用它们的缓存版本。
我用了很多东西。
<!-- Cache Control-->
<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" />
<!-- No results. Absolutely. All content still cached-->
我也尝试了这里的所有方法: Office-js addin with Excel and Edge Webview - how to delete cache?
同样没有成功。
现在我用两种3种方式进行"development"。 1. 在 Manifest.xml 中更改起点。每次改变一些东西。 2. 在文件*.csproj 和*.cproj.user 中更改解决方案Web 部分的端口。这也需要在每次尝试更改代码时完成。 3.每次更改后等待明天。是的,它有帮助。
我哪里错了?请帮忙!
更新:我刚刚了解到 WebView2。我敢肯定,在我的案例中我使用的是常用的 Edge WebView。
已更新Office-js addin with Excel and Edge Webview - how to delete cache?
在我们的示例中,我们使用 Azure App Service (IIS) 作为 Office 加载项的后端。 并且我们添加了以下 web.config 设置,让客户端在每次访问时重新验证所有缓存的文件:
...
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="0.00:00:00" cacheControlCustom="must-revalidate" />
</staticContent>
...
当然,cacheControlMaxAge可以根据您的需要进行调整。