如何清除客户端浏览器缓存为Excel 2016任务窗格加载项在Mac? [英] How to clear client side browser cache for Excel 2016 Task Pane add-in on Mac?

查看:294
本文介绍了如何清除客户端浏览器缓存为Excel 2016任务窗格加载项在Mac?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是以前的问题,其中如何确保我在任务窗格加载项中看到最新的JS代码的答案涉及通过服务器添加的meta / no控制客户端缓存行为-cache标签(或版本化服务器资源)。

This is a follow-up to a previous question where the answer to "How do I ensure I see the latest JS code in my Task Pane add-in" involved controlling the client side caching behavior via server-added meta/no-cache tags (or versioning the server resources).

但是,我正在寻找一种手动方式,在客户端,结束-user清除看起来存储JavaScript文件的客户端缓存,并阻止服务器上更新的JS文件被任务窗格加载项使用。在开发过程中,我将在服务器上频繁更新JS资源,并且正在寻找一个可以使用更新文件的客户端解决方案。

However, I am looking for a manual way, on the client, for the end-user to clear out the client side cache that appears to be storing JavaScript files and preventing an updated JS file on the server from being used by the Task Pane add-in. During development, I'll be updating the JS resources frequently on the server and I am looking for a client side solution that allows those updated files to be used.

环境:在Mac上运行的Excel 2016的桌面版本(OSX 10.11.5)
使用Excel / Office.js的v1.2的任务窗格加载项。

Environment: Desktop version of Excel 2016 running on Mac (OSX 10.11.5) Task Pane add-in using v1.2 of the Excel/Office.js.

方案:将插件工件部署到Web服务器,在Mac上运行加载项。然后在加载项中更新foo.js中的代码,重新部署到Web服务器。运行加载项,并从foo.js中查看旧的(更新前)行为。

Scenario: deploy add-in artifacts to web server, run add-in on Mac. Then update code in foo.js in add-in, re-deploy to web server. Run add-in and see old (pre-update) behavior from foo.js.

我尝试了


  1. 在同一台Mac上,直接从Safari中的网络应用程序加载foo.js。我可以看到我希望在更新版本中的js代码的更改。

  1. On the same Mac, loaded foo.js directly from the web app in Safari. I can see the changes in the js code that I expect to be in the updated version.

清除Safari缓存(隐私>删除所有网站数据)我怀疑这不会基于#1 - Safari不会与Excel共享缓存但值得一拍) - 没有改变任何东西。

Cleared the Safari cache (Privacy > Remove All Website Data) (I suspected that this would not work based on #1 - Safari does not appear to share a cache with Excel but worth a shot) - did not change anything.

找到一个缓存 - 已删除〜/ Library / Containers / com.microsoft.Excel / Data / Library / Caches / com.microsoft.Excel - 没有帮助。

Poked around under ~/Library/Containers/com.microsoft.Excel trying to find a cache - deleted ~/Library/Containers/com.microsoft.Excel/Data/Library/Caches/com.microsoft.Excel - no help.

使用任务窗格的上下文菜单中的重新加载菜单项(在Mac上看起来像$ i $ b像[i]) - 没有区别:仍然看到旧的foo.js。

Used the Reload menu item from the Task Pane's context menu (looks like [i] on the Mac) - no difference: still seeing old foo.js.

Excel(桌面)2016任务窗格添加引用的JavaScript文件在哪里 - 存储? (在Mac上),最终用户如何删除它们?

Where are the JavaScript files referenced by an Excel (desktop) 2016 Task Pane add-in stored? (on the Mac) and how can the end user remove them?

推荐答案

我偶然发现了 com.Microsoft.OsfWebHost 同时使用Mac上的终端中的defaults命令。一些Google搜索结果已经出现了这个文章,这基本上提供了答案。在稍微细化之后,这就是我所做的一切:

I stumbled upon com.Microsoft.OsfWebHost while poking around using the "defaults" command from a Terminal on the Mac. Some googling turned up this article which basically provided the answer. In a slight refinement to what is instructed there, this is what I did:


  1. 确保我退出了Excel

  2. 在Finder中,导航到
    〜/ Library / Containers / com.Microsoft.OsfWebHost / Data / Library / Caches

  3. 重命名(或删除)名为com.Microsoft.OsfWebHost那里

  4. 在Excel中打开了我的工作簿(已经插入了插件)

  5. 似乎没有加载,所以我使用任务窗格中的上下文菜单中的重新加载命令

  1. ensured that I had quit Excel
  2. in Finder, navigated to ~/Library/Containers/com.Microsoft.OsfWebHost/Data/Library/Caches
  3. renamed (or deleted) the folder named "com.Microsoft.OsfWebHost" there
  4. opened my workbook in Excel (it already has the add-in Inserted)
  5. nothing seemed to be loading, so I used the Reload command from the context menu in the Task Pane

现在我可以看到我的更新版本的java脚本文件已被加载。

Now I could see that my updated version of the java script file has been loaded.

这只是基于经验证据,没有微软或苹果文档的佐证,所以你的里程可能会有所不同。

This is based on empirical evidence only, no corroboration from Microsoft or Apple doc, so your mileage may vary.

BTW,com.Microsoft.OsfWebHost有一些有趣的默认值属性:

BTW, there are some interesting "defaults" properties for the com.Microsoft.OsfWebHost:

defaults read com.Microsoft.OsfWebHost
{
WebKitCacheModelPreferenceKey = 1;
WebKitDebugFullPageZoomPreferenceKey = 1;
WebKitPluginsEnabled = 0;
WebKitUsesPageCachePreferenceKey = 0;
}

谷歌搜索WebKitCacheModelPreferenceKey没有提供任何官方文档,但似乎有将其设置为0的建议可能会抑制缓存。

Googling for WebKitCacheModelPreferenceKey did not turn up any official documentation, but there seem to be suggestions that setting it to 0 might suppress caching.

这篇关于如何清除客户端浏览器缓存为Excel 2016任务窗格加载项在Mac?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆