0

Recently we have added a new javascript function which is called in one of our jsp file and when for the first time we have deployed the ear file with new js file , I was getting an error as "javascript function is not defined" and when we tried after a half day , I was able to see new javascript function , same in the case of QA Environment , so wanted to know what is the default cache time of Javascript files in IE11 and Chrome. Also will the cached javascript file cleared out by itself withput refresing the page or clearing the cache manually and new Javascript file from ear file be picked up in prod environment as well ? We are hosting our application using JBOSS server.

Any Help would be appriciated. Thanks in Advance.

Phani
  • 1
  • 1
  • "default cache time" is whatever comes back in the headers of the request. This is a server issue, and requires configuration of your server (and CDN if applicable) to ensure that the relevant headers instruct the browser and any intermediate caches on how to cache and when to fetch from upstream. – spender Aug 19 '21 at 14:52
  • Does this answer your question? [How can I force clients to refresh JavaScript files?](https://stackoverflow.com/questions/32414/how-can-i-force-clients-to-refresh-javascript-files) – spender Aug 19 '21 at 14:53
  • So will the cached js file be cleared out by itself after specific time if we do not use versioning of js files ? – Phani Aug 19 '21 at 15:02
  • You can add timestamp to the JS files while loading so you will get latest version of file every time – pravid Aug 19 '21 at 16:44

0 Answers0