Office Add-ins Office-js Cache location

Finally found this. I couldn't clear the cache of headers and footers applied. Therefore, all the revised template uploads weren't reflecting any changes. But delete all files/folders in: %LOCALAPPDATA%\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\AC\#!123\INetCache\
does the trick! I wonder if I could use this on Al's Ribbon logo, which is still showing the old logo. After all, how many more locations would Office-JS wants to cache this?

Source: https://stackoverflow.com/questions/34168603/office-add-ins-caching-my-html-file

Today (Win 10 1903 and newest Office 2016) Office AddIns are using Edge as WebViewHost. The WebViewHost seems to store the cached files here:

dir /s %LOCALAPPDATA%\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\AC\#!123\INetCache\

In our case we are using Azure App Service (IIS) as backend for our Office AddIn. And we added the following web.config setting to let the client re-validate all cached files on each access:

...
  <system.webServer>
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="0.00:00:00" cacheControlCustom="must-revalidate" />
    </staticContent>
...

As with MAC, I don't know if this will be an issue, but if so, one place this cache may be stored is here, delete everything in:

/Users/{your_name_on_the_device}/Library/Containers/com.Microsoft.OsfWebHost/Data/ 

This entry was posted in Questions, Technical. Bookmark the permalink.

One Response to Office Add-ins Office-js Cache location

  1. timlyg says:

    Here's an update on this:
    According to https://docs.microsoft.com/en-us/office/dev/add-ins/testing/troubleshoot-development-errors

    It seems that the previous cache location ...#!123\INetCache\ doesn't work anymore.

    There's a new cache location to delete:
    For Windows:
    %LOCALAPPDATA%\Microsoft\Office\16.0\Wef\ or actually this one: %LOCALAPPDATA%\Microsoft\Office\15.0\OfficeFileCache
    Or maybe still delete this too:
    %userprofile%\AppData\Local\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\AC\

    For Mac:
    Add-ins are often cached in Office for Mac, for performance reasons. Normally, the cache is cleared by reloading the add-in. If more than one add-in exists in the same document, the process of automatically clearing the cache on reload might not be reliable.

    You can clear the cache by using the personality menu of any task pane add-in.

    Choose the personality menu. Then choose Clear Web Cache.

    Note

    You must run macOS version 10.13.6 or later to see the personality menu.

    Screenshot of clear web cache option on personality menu

    You can also clear the cache manually by deleting the contents of the ~/Library/Containers/com.Microsoft.OsfWebHost/Data/ folder.

    Note

    If that folder doesn't exist, check for the following folders and if found, delete the contents of the folder:

    ~/Library/Containers/com.microsoft.{host}/Data/Library/Caches/ where {host} is the Office application (e.g., Excel)
    ~/Library/Containers/com.microsoft.{host}/Data/Library/Application Support/Microsoft/Office/16.0/Wef/ where {host} is the Office application (e.g., Excel)
    ~/Library/Containers/com.microsoft.Office365ServiceV2/Data/Caches/com.microsoft.Office365ServiceV2/
    ~/Library/Containers/com.microsoft.Office365ServiceV2/Data/Library/Caches/com.microsoft.Office365ServiceV2/
    For iOS:
    Call window.location.reload(true) from JavaScript in the add-in to force a reload. Alternatively, you can reinstall Office.

    Update for Mac:
    Forget all that instructions above for Mac. Someone at work figured this out:
    Go to Finder, go to GO menu and hold the Option key to reveal the hidden Library folder,
    Just delete everything in: ~/Library/Containers/Word (or Microsoft Word)/Cache/*

Leave a Reply to timlyg Cancel reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.