[英]Force clear cache in OpenUI5
I have created an OpenUI5 app and I want to relase a new version daily. 我已经创建了一个OpenUI5应用,我想每天发布一个新版本。 But I found some problems: 但是我发现了一些问题:
Now I have this meta-tags on my index page: 现在,我在索引页面上有了这个元标记:
<meta http-equiv="expires" content="0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
Is there a way to force the reload of all content always? 有没有办法始终强制重新加载所有内容? (or when I modify the version number?) (或者当我修改版本号时?)
This really depends on what server you are using to serve the content and whether you can set the headers when it serves the various JS files to the client. 这实际上取决于您使用哪台服务器提供内容,以及当它向客户端提供各种JS文件时是否可以设置标头。 Unfortunately this is probably just disabling the cache all the time. 不幸的是,这可能只是一直禁用缓存。
There is also a built in concept called "Cache-buster" which is documented here - OpenUI5 Cache Buster . 还有一个称为“ Cache-buster”的内置概念,在此处记录-OpenUI5 Cache Buster 。 This does something clever and puts a timestamp or version number in the url which is read from a config file. 这做得很聪明,并将时间戳或版本号放在从配置文件读取的url中。 If you are hosting on an ABAP stack then this is built in for you and easy to enable, if you aren't it's still easy to manually implement. 如果您托管在ABAP堆栈上,那么它将为您内置并且易于启用;如果不是,则手动实现仍然很容易。
I have solved my problem using ONLY 我仅使用即可解决问题
<meta http-equiv="cache-control" content="no-cache" />
as show in this post: 如这篇文章中所示:
https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.