We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
开发阶段,配置设置cache为false,更新了模板代码,监听后也重新编译了模板JS,但浏览器还是缓存原来的模板JS文件,我觉得是不是当cache为false时,异步请求模板JS地址后面加个时间戳,这样就不会让浏览器缓存啦。上线后再改回来,如何?
The text was updated successfully, but these errors were encountered:
你可能混淆了概念,tmodjs 编译后的只是一个普通的 js 文件,你要处理的应该是浏览器的设置、或者给 js 文件加时间戳等一系列方式避免缓存
Sorry, something went wrong.
我明白,我只是举个解决办法。浏览器的设置一般都是缓存同名文件,所以想加时间戳来解决。但时间戳应该是在template.js里配置,因为我普通的 js 文件模板是通过你template异步读取,template.js也是你这个tmod编译出来的,所以编译出来的template.js代码里应该有个判断,如果要加时间戳,则:模板路径/js模板名+‘?当前时间或随机数’,这样来异步加载模板文件吧
不好意思,我搞错了。是requireJS加载的,我错了,-_-!!
No branches or pull requests
开发阶段,配置设置cache为false,更新了模板代码,监听后也重新编译了模板JS,但浏览器还是缓存原来的模板JS文件,我觉得是不是当cache为false时,异步请求模板JS地址后面加个时间戳,这样就不会让浏览器缓存啦。上线后再改回来,如何?
The text was updated successfully, but these errors were encountered: