简体   繁体   中英

Chrome and Firefox does refresh all js file except one

I'm running an application on jBoss.

In one page there are many js files. Chrome and Firefox see the changes on all js file when I reload the page, except one.

I open Chrome (firefox) in unknown mode, disabled the cache of Chrome console (Firefox console), reload the page, clean and restart the application server and rebuild the application.

Nothing.

I don't know what to do.

When linking the scripts on you pages you can put something after the file like

<script language="JavaScript" src="<file_name.js>?yyyymmdd"></script>. 

This "yyyymmdd" can be the current Date/datetime (never caches) or the last modification date of the js file you are including (it cancel the cache only when you modify the script).

That is the approach we use.

在Chrome浏览器中,转到开发人员工具(按F12键),再转到“网络”面板,然后选中“禁用缓存”选项并加载页面。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM