OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
657 stars 93 forks source link

JSON Metadata file cached permanently #3316

Closed wynntee closed 2 months ago

wynntee commented 2 years ago

Message from office-js bot: We’re closing this issue because it has been inactive for a long time. We’re doing this to keep the issues list manageable and useful for everyone. If this issue is still relevant for you, please create a new issue. Thank you for your understanding and continued feedback.

Expected behavior

Excel should fetch the latest JSON metadata file from the server, by respecting the HTTP Cache-Control header.

Current behavior

Excel permanently caches the JSON metadata file. As a result, users do not have access to any new custom functions since the file was cached.

The only ways to get Excel to fetch the latest JSON file are: (1) Submit a new manifest, even though the manifest is unchanged, which seems a bit silly. (2) Reinsert the Add-in from Office Store. (3) Clear the Office Cache.

All of the above seems unnecessarily complicated, when we could simply respect the HTTP cache controls returned by the server.

Incidentally, cache controls for the HTML and JavaScript files are respected. So why can't we treat the JSON metadata file in the same way?

Steps to Reproduce

  1. Insert any add-in which has a custom functions JSON metadata file.
  2. See the list of custom functions (Formula > Insert Function > [Name of Add-in])
  3. Update the JSON metadata file with a new custom function.
  4. Close and open Excel again.
  5. See the list of custom functions. The new custom function will not appear.

Context

RuizhiSunMS commented 2 years ago

@grangeryy plz take a follow. I've contacted with jinlong.

grangeryy commented 2 years ago

@wynntee thank you for reporting the issue. We'll investigate the issue soon. @jiju-MS

RuizhiSunMS commented 2 years ago

Thank you @wynntee for you suggestion. Another way which might better help you is the link of https://aka.ms/m365dev-suggestions called Microsoft 365 Developer Platform Ideas Forum for Microsoft 365 Developers Platform. You can see if your suggestion has been requested or request a new one if not. And please let us know if you add one. Thanks.

wynntee commented 2 years ago

Thank you @RuizhiSunMS. I've created a new suggestion.

RuizhiSunMS commented 2 years ago

Thank you @RuizhiSunMS. I've created a new suggestion.

roger that.

AlexJerabek commented 1 year ago

Transferring this issue to the office-js repo, where product issues can be better tracked.

rundongmsft commented 1 year ago

Hi @wynntee, do you still encounter this issue now? I recently debugged on my side and found that every time the add-in is reinserted, CF metadata will be forced to update, and the newly added custom function will also appear in the Formula list.

wynntee commented 1 year ago

Hi @rundongmsft , yes the issue persists. The point is we shouldn't have to re-insert the add-in. Changes on the server-side should be reflected automatically. We cannot expect end-users to keep re-inserting the add-in just to refresh the cache.