我以为我的问题是我的javascript被缓存而且即使使用更新的版本标签也没有更新,例如:
但我意识到问题是我的html文件被缓存…所以浏览器甚至不知道有一个新的脚本文件.
我不想禁用缓存,但是有没有办法让浏览器知道它没有最新的html文件? (这是我放在我的html文件中,还是放在我的apache2服务器上?)
最佳答案
@H_404_16@
<Meta http-equiv="cache-control" content="max-age=0" />
<Meta http-equiv="cache-control" content="no-cache" />
<Meta http-equiv="expires" content="0" />
<Meta http-equiv="expires" content="Tue,01 Jan 1980 1:00:00 GMT" />
<Meta http-equiv="pragma" content="no-cache" />