Microsoft JavaScript Add-in Clear Static website cache

Viewed 85

We have 2 Microsoft add-ins written using the Office JS framework.As we understand we are loading the static website (taskpane.html) whenever the pane is loaded.

Changes to our plugin are mostly cosmetic, and due to that we usually do not update the version of the plugin, and just push a new version of code to the bucket hosting the static website.

The issue we are facing is with caching of the build bundle, unless we manually clear the cache using developer tools, we do not get the updated website inside the plugin pane.

We have disabled the caching at S3 end to return Cache-Control header value as no-cache, but even after that I see http status code 304 on plugin refresh against the task.html code.

Are we supposed to distribute a new version of plugin event for website updates ?

1 Answers

Are we supposed to distribute a new version of plugin event for website updates ?

No, that is not required.

We have disabled the caching at S3 end to return Cache-Control header value as no-cache

But the loaded by the web browser files are already cached on the end user machine. To get them requested anew you need to clear the cache for users. Only after that you will get new requests according to the HTTP headers set on the server. Note, the Cache-Control header field holds directives (instructions) — in both requests and responses — that control caching in browsers and shared caches (e.g. Proxies, CDNs).

It is not clear what directives are used for the Cache-Control HTTP header.

Related