-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Sometimes between deploys we have to change our javascript files (Example: we add a new function for a custom component to use) and if we don't clean the cache of the browser a javascript error will occur saying the new change isn't defined.
Is there a mechanism in zk to avoid this error by refreshing the javascript sources? I would like to avoid asking users to clean the cache of their browsers after a deploy.
Hello eclipse1,
A trick you could using DspFns.setCacheControl(String, int). This is used to set the Cache-Control
https://www.zkoss.org/wiki/ZKDeveloper'sReference/PerformanceTips/MinimizeNumberofJavaScriptFilesto_Load
Another options but a little more advanced is to update your query string parameter in order to version the resource. For example:
<script>document.write('<script src="/myJavascript.js?dev=' + Math.floor(Math.random() * 100) + '"\><\/script>');</script>
Best Regards,
Darksu
Asked: 2016-10-04 09:59:14 +0800
Seen: 30 times
Last updated: Oct 06 '16
Facing issue in masking on phone [closed]
coerceFromString_ override no longer works from 6.5.1 [closed]
Execute Javascript on component visible
Is there a way to resolve view model properties as input to client side javascripts?
scrollbar listner for 2 grid [closed]
Theme javascript wpd file not found