https://docs.microsoft.com/en-us/office/dev/add-ins/testing/sideload-office-add-ins-for-testing
There is no explication about how to make the Office application to show updates for a side-loaded add-in. In practice the Office 365 or IE 11 caching mechanism makes extremely difficult to see the changes made in add-in code. For some reasons the application is stuck in showing the old code, even if a renamed the files on the server and change the manifest.
@ltanase77 thanks for providing this feedback; I can look into adding this type of info to the sideloading article. A question for you though -- when you say that "the application is stuck seeing the old code -- what type of code changes are you making that aren't being automatically reflected by the add-in? i.e., changes to task pane HTML, changes to task pane CSS, changes to the JavaScript, or changes to the manifest? Thanks in advance for your feedback about this!
Hi,
Thank you for your quick reply. Mostly the javascript changes are not reflected by the add-in. I remember that I had some problems with css files in the past, but was some time ago and I do not remember the details.
The current add-in is based on vuejs framework and fabricjs for UI and the javascript code is doing the heavy lifting in generating the html.
The problem is that sometime it works and the updates to the code are reflected in the add-in immediately but other times do not. For tracking what is happening I have added a version number within the html and I am changing it every time I make a change to the code. If the old version number shows up it means that the old code is loaded by the Office host applications, instead of the new code. Anyway usually is pretty clear when the updates are not reflected, as certain new functionalities added does not work or error message persist although they should not.
I have tried various scenarios in coping with that problem, after googling online for solutions, like:
Ultimately I have succeeded in making the add-in loading the new code, but it seemed to me that this solutions are erratic and does not provide the same results each time i have used them.
Last time none of them work and after several attempts in changing the name of the index.html file only changing the url in the manifest from https://www.domain.com (which worked fine until then) to https://domain.com, solved the issue.
Similar questions are raised on stackoverflow: https://stackoverflow.com/questions/43586353/cleaning-office-add-in-cache/43589705#43589705 and https://stackoverflow.com/questions/51477427/office-web-add-ins-cache-old-js-code?noredirect=1&lq=1, but the answers there does not seem to offer a clear solution in solving the issue.
I would like the documentation to mention, if possible, what is the expected behavior for side loading an add-in, when we update the code. Should the add-in reflect the changes immediately or there is a caching mechanism preventing this and reflecting the changes depends on such mechanism?
If the expected behavior is to reflect the changes what could be steps to follow when the expected behavior does not happens. Should we clean Office host application cache (Wef folder) or IE cache or both? Is sufficient changing the name of the entry point of the add-in in order to force a refresh? Should we do any other steps? Is there any order in doing this steps and so on?
If it is not possible to offer a clear cut solution, because of the many scenarios that may be possible, I expect to have at least some short general guidance on the matter.
@ltanase77 thanks for providing this detailed information. I'm going to transfer this issue to the OfficeDev/office-js repo so that members of the product team can provide feedback about the caching behavior you've described. (I'll plan to update the documentation based on information received there.)
@sumurthy can you please assign this issue to someone on the product team who can can provide clarification about the add-in caching issue that @ltanase77 has described? Thanks!
@croicu could you look into this?
Adding @jeremy-msft as well
Any updates on this. We are having the same issue ... what is the recommended approach for refreshing an office web add-in following a deployment of updated add-in files?
Any update on this?
Hi @dakshika, please see https://docs.microsoft.com/en-us/office/dev/add-ins/testing/clear-cache for guidance on clearing the add-ins cache. If you are still seeing issues, please also try clearing the browser cache in the corresponding browser (https://docs.microsoft.com/en-us/office/dev/add-ins/concepts/browsers-used-by-office-web-add-ins).
Most helpful comment
Any updates on this. We are having the same issue ... what is the recommended approach for refreshing an office web add-in following a deployment of updated add-in files?