cancel
Showing results for 
Search instead for 
Did you mean: 

SAP MII UI5 Application Cache Buster not working

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:

  • NetWeaver 7.5 AS Java
  • MII 15.1 sp 03 patch 16
  • SAPUI5 on server v1.38.11

On MII server web.xml file:

  • f:\usr\sap\M5D\J00\j2ee\cluster\apps\sap.com\xapps~xmii~ear\servlet_jsp\XMII\root\WEB-INF\web.xml
  • Added
<!-- ============================================================== -->
<!-- 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:

  • http://<server name>:50000/XMII/CM/coeMES/Index.irpt
  • Component.js and manifest.json are in the same folder as 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

MII Related Cache Buster Question - Not Rebuilding File

Accepted Solutions (1)

Accepted Solutions (1)

former_member185280
Active Contributor

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

0 Kudos

Thank you for the quick response christian.libich5. I will attempt this route until SAP provides an official solution. Hopefully Sam knows if this is available.

schfer_christian
Explorer
0 Kudos

Hi, do we have any news here?

Your Version works for the i18n and views but not for the controller.

Thank you for your time

former_member185280
Active Contributor
0 Kudos

The method above is working in my experience for controller files or any file ui5 is loading dynamically via Ajax. ui5 does have a lot of options around how you initialize and load things. Can you share how you are bootstrapping ui5?

Regards,
Christian

0 Kudos

@Christian Schäfer for me also its not working for the controller , can you help me with a solution here

0 Kudos
christian.libich5 for me also the controller and the JS files are not taking these versions , can you please help me here
former_member185280
Active Contributor
0 Kudos

Bhanu,
We may be able to help you but would need to provide a lot more information. I recommend posting a new question with examples of your code and any other relevant information like versions and development workflow.

Regards,
Christian

0 Kudos

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

Answers (2)

Answers (2)

former_member408755
Discoverer
0 Kudos

Hello, do you knew if now the Netweaver AS Java .. support the AppCacheBusterFilte ?????

thanks in advance

Former Member
0 Kudos

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.