Additional code changes are being added to fix the caching issue for plugin resource files that are compressed with the file extension .jgz which you may not need if you're not compressing your plugin resources files.
Original Message:
Sent: Thu February 29, 2024 03:25 PM
From: Andreas Baaserud Hauge
Subject: Client side Browser Cache prevent update of new version of custom Content Navigator Plugin
That seems to work just fine - thought perhaps didnt need to clear cache first time.
So this is good.
Thanks.
The fixpack 16 for version 3.0.11 - regarding Cache-Control, will it do something else than adding extra Cache-Control header like this in ESAPI WAF API Policy?
<add-header name="Cache-Control" value="no-cache" path=".*/plugin/.*/getResource/.*"/>
------------------------------
Andreas Baaserud Hauge
Senior Consultant
tietoevry
Original Message:
Sent: Thu February 29, 2024 11:08 AM
From: ANDY Choi
Subject: Client side Browser Cache prevent update of new version of custom Content Navigator Plugin
The browser will continue using the prior cache that was made with responses excluding the Cacheh-Control header until its default lifetime of the cache is reached so the fix would only apply after any prior cache is cleared. You should no longer need to clear the browser cache manually once the browser starts using the cache made with responses including the Cache-Control header set to no-cache. To verify the fix, you can clear the browser cache manually, load the plugin resources, verifiy the browser uses the cache on subsequent calls, update the plugin with updated resources, and check if the browser clears the cache automatically and uses the updated plugin resources.
------------------------------
ANDY Choi
Original Message:
Sent: Thu February 29, 2024 09:44 AM
From: Andreas Baaserud Hauge
Subject: Client side Browser Cache prevent update of new version of custom Content Navigator Plugin
Hi @ANDY Choi
Isn't the whole point not to clear browser cache - ref APAR IO29417
If I clear browser cache, everything is good - but this is no solution as I cannot do that for all of our users.
------------------------------
Andreas Baaserud Hauge
Senior Consultant
tietoevry
Original Message:
Sent: Thu February 29, 2024 09:24 AM
From: ANDY Choi
Subject: Client side Browser Cache prevent update of new version of custom Content Navigator Plugin
Hi Andreas,
Did you clear the browser cache before you do another set of tests?
Do you see the Cache-Control response header set to no-cache for the request made to retrieve plugin/MyPlugin/getResource/MyPlugin.js?
What value do you see as the Last-Modified response header?
Do you see the browser including the If-Modified-Since header when requesting the file?
The server should respond with 304 Not Modified when the If-Modified-Since and the Last-Modified header values match or with 200 along with the content otherwise.
Regards,
Andy
------------------------------
ANDY Choi
Original Message:
Sent: Thu February 29, 2024 07:22 AM
From: Andreas Baaserud Hauge
Subject: Client side Browser Cache prevent update of new version of custom Content Navigator Plugin
Some updates from me after testing a few things.
I added a new entry for Cache-control inside ECMClient/config/ESAPIWafPolicy.xml.default
Following Cache-Control headers active
<add-header name="Cache-Control" value="no-cache, no-store" path=".*/|.*\.jsp|.*/jaxrs/.*|.*/api/.*"/><add-header name="Cache-Control" value="no-cache" path=".*/plugin/.*/getResource/.*"/>
If you look at the path value it is equal to .*/plugin/./getResource/.
My javascript are not being reloaded with this setup
I have then tried to specify the specific javascript I need to reload
<add-header name="Cache-Control" value="no-cache" path=".*/plugin/MyPlugin/getResource/MyPlugin.js"/>
I still see old content of MyPlugin.js
Below .*/plugin/./getResource/. I have both javascripts and css among other resources - but I dont see MyPlugin.js under plugin/MyPlugin/getResource/ when inspecting the browser with developer tool.
Any ideas?
------------------------------
Andreas Baaserud Hauge
Senior Consultant
tietoevry
Original Message:
Sent: Wed February 28, 2024 02:55 AM
From: Andreas Baaserud Hauge
Subject: Client side Browser Cache prevent update of new version of custom Content Navigator Plugin
Thanks a ton for sharing!
Inside file install_dir/WEB-INF/ESAPIWafPolicy.xml.default
Default value for 3.0.11 seems to be
<add-header name="Cache-Control" value="no-cache, no-store" path=".*/|.*\.jsp|.*/jaxrs/.*|.*/api/.*"/>
Would this be the new path value?
<add-header name="Cache-Control" value="no-cache, no-store" path=".*/|.*\.jsp|.*/jaxrs/.*|.*/api/.*|.*/plugin/.*/getResource/.*"/>
------------------------------
Andreas Baaserud Hauge
Senior Consultant
tietoevry
Original Message:
Sent: Wed February 28, 2024 02:12 AM
From: JIE ZHANG
Subject: Client side Browser Cache prevent update of new version of custom Content Navigator Plugin
The customer also can try to add this to ESAPI WAF policy file:
<add-header name="Cache-Control" value="no-cache" path=".*/plugin/.*/getResource/.*"/>
And it will be added into next release, ICN 3.0.15 iFix 2 (end of April), 3.0.14 iFix 5 (end of April), and 3.0.11 iFix 16 (end of March)
------------------------------
JIE ZHANG
Original Message:
Sent: Tue February 27, 2024 07:59 AM
From: Andreas Baaserud Hauge
Subject: Client side Browser Cache prevent update of new version of custom Content Navigator Plugin
Hi,
As the title describes we have a problem where user do not get the updated functionality from our custom Content Navigator Plugin when we deploy a new version.
Our quick fix today is to tell users to clear the browser cache and reopen browser. This is not a good solution for us, since we are privileged to have many users of Content Navigator, and each of them need to perform this operation.
How can we come around this without telling users to clear browser cache each time we deploy a new version?
Are there some settings in Content Navigator we can switch on or can I create a plugin that will clear cache for the user(this feels like working against Content Navigator)?
Appreciates any post <3
------------------------------
Andreas Baaserud Hauge
Senior Consultant
tietoevry
------------------------------