on 2017 Nov 28 3:19 PM
I have not found a clear answer for this issue. UI5 application files are caching and are not updating when the files change on the server. The MII server installed on NetWeaver 7.5 AS Java is not creating the sap-ui-cachebuster-info.json file. Am I missing a step or is my project not structured correctly?
System information:
On MII server web.xml file:
<!-- ============================================================== -->
<!-- AppCacheBuster Filter -->
<!-- ============================================================== -->
<filter>
<display-name>AppCacheBusterFilter</display-name>
<filter-name>AppCacheBusterFilter</filter-name>
<filter-class>com.sap.ui5.resource.AppCacheBusterFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>AppCacheBusterFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
In the application Index.irpt:
<script src="/sapui5/resources/sap-ui-cachebuster/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-compatVersion="edge"
data-sap-ui-libs="sap.m,sap.ui.commons,sap.ui.table,sap.ui.layout"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-appCachebuster="./">
</script>
The server has been rebooted a few times when trying to troubleshoot this issue. I have found related support articles, but nothing seems to work (most seem to cover UI5 running on NetWeaver AS ABAP).
Enable Filter for JAVA Applications
App Cache Buster - for ABAP Server
MII Related Cache Buster Question - Enable Caching of JS Files
Request clarification before answering.
I haven't looked at it in a while but I think the cache buster only works for ui5 apps served on the abap stack. The solution I came up with for application resources served from MII is to create a version.json file with something like { "_TheAppVersion": "1.0" } in it that I update every time we make a change or move a project. Then I do something like the code below when I init the app. This works because UI5 loads all of the application resources via ajax. We are basically appending a version number to all ajax call urls globally with the ajax setup. So if the version/url value is the same as what the the browser already has cached it won't go out and download the files again. If the version/url has changed the browser will go get the new files. Note this method only really works for application resources not necessarily the core ui5 library.
salvatore.castro and michael.solwecki , is there an official/supported way that you know of to handle this issue re MII?
sap.ui.getCore().attachInit(function () {
//force update on page load if version changed - i.e. app cache buster
$.post( "/XMII/CM/TheApp/version.json?"
+ "&__=" + new Date().getTime()
, function(data){
$.ajaxSetup({
data: {
_TheAppVersion: data._TheAppVersion
}
});
var theapp = new sap.ui.core.ComponentContainer({
name : "TheApp",
height : "100%"
});
theapp.placeAt("content");
return;
}
, 'json'
);
});
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Christian Schäfer for me also its not working for the controller , can you help me with a solution here
christian.libich5 thanks for the information
i have posted the question now in the below link, Please let me know for any more files needed for reference
https://answers.sap.com/questions/12973789/sap-mii-ui5-application-cache-buster-not-working-f.html
Hello, do you knew if now the Netweaver AS Java .. support the AppCacheBusterFilte ?????
thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can tell you that Netweaver AS Java 7.5 doesn't support the AppCacheBusterFilter. It is only in the ABAP release.
We are taking a look at implementing a similar solution for MII in MII 15.1 to better handle caching but it is not released yet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.