Description of problem: When pod containing dynamic plugin gets updated, firefox wont load new chunks even after refreshing the page with ctrl+f5. The chunks are cached. Chrome is ok, it does not cache the chunks. Workaround for the FF is to clear or disable the cache. Version-Release number of selected component (if applicable): 4.10 How reproducible: always Steps to Reproduce: 1. deploy dynamic plugin 2. access dynamic plugin pages to load the chunks 3. update dynamic plugin 4. access the pages again Actual results: pages are not updated Expected results: pages are updated Additional info: Console probably does not specify any cache policy so the behavior depends on the specific browser.
Rastislav could you please specify the version of OCP you used? I could not reproduce the issue on 4.10.0-0.nightly-2022-01-31-012936, meaning that after refreshing the page I could see updated content of the demo-dynamic-plugin. When checking the response header I can also see the `cache-control: no-cache, no-store, must-revalidate` header present.
Tested on FF 92.0.1 && Chrome 98.0.4758.80
How can we update dynamic plugin with plugin already deployed?
I saw this on ACM dynamic pluign and it turns out ACM backend does not specify correct cache policy https://github.com/stolostron/console/blob/0cf7e9b88b13f01c032249f15860babee203b37f/backend/src/routes/serve.ts#L34 OCP does not override cache policy defined by dynamic plugin so the issue is on ACM side. Assigning the bug to the ACM. @yapei to update a dynamic plugin you can just update container image reference in the dynamic plugin's pod.
Verified on firefox with acm build 2.5.0-DOWNSTREAM-2022-05-05-15-16-11 then patched the acm/mce plugins with a newer reference with build (2.5.0-DOWNSTREAM-2022-05-08-12-27-27) and saw changes in the network tab as discussed with kcormier
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: Red Hat Advanced Cluster Management 2.5 security updates, images, and bug fixes), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:4956
(In reply to Rastislav Wagner from comment #0) > Description of problem: > When pod containing dynamic plugin gets updated, firefox wont load new > chunks even after refreshing the page with ctrl+f5. The chunks are cached. > Chrome is ok, it does not cache the chunks. https://ballsportsgear.com/ > Workaround for the FF is to clear or disable the cache. > > Version-Release number of selected component (if applicable): > 4.10 > > > How reproducible: > always > > Steps to Reproduce: > 1. deploy dynamic plugin > 2. access dynamic plugin pages to load the chunks > 3. update dynamic plugin > 4. access the pages again > > Actual results: > pages are not updated > > > Expected results: > pages are updated > > > Additional info: > Console probably does not specify any cache policy so the behavior depends > on the specific browser. Based on your description, it seems that Firefox is using a different cache policy than Chrome, which causes it to store and reuse the old chunks even after refreshing the page. This could be due to the default settings of Firefox or the way your plugin sends the HTTP headers. There are a few possible solutions that you can try: You can customize the cache policy of Firefox using Group Policy or policies.json1. This allows you to override the automatic cache management and set the maximum cache size or disable the cache completely. You can also modify the HTTP headers of your plugin to include the Cache-Control directive2. This instructs the browser how to cache the response. For example, you can use Cache-Control: no-cache to tell the browser not to cache the response at all, or Cache-Control: max-age=0 to tell the browser to revalidate the response every time. Alternatively, you can append a unique query string to the URL of your plugin, such as a timestamp or a version number. This will trick the browser into thinking that the URL is different and force it to fetch the new chunks. I hope this helps you resolve your issue