How to download sapui5 resources in the background

In our application, we load several SAPUI5 libraries. index.html has the following code for loading SAPUI5 resources.

<script src="resources/sap-ui-cachebuster/sap-ui-core.js"
        id="sap-ui-bootstrap"
        data-sap-ui-libs="sap.ui.commons,sap.ui.table,sap.ui.ux3,sap.m"
        data-sap-ui-theme="sap_bluecrystal" 
        data-sap-ui-appCacheBuster="./">

</script>

In our web.xml we mentioned https://sapui5.hana.ondemand.com as the com.sap.ui5.resource.REMOTE_LOCATION file for loading resources.

What we are observing is that the application takes a very long time to download for the first time. And network calls give an idea that loading UI5 resources takes maximum time. Is there a way to load UI5 resources faster? or in the background? A tip or sample code will be helpful here. Thank you

+3
source share
2 answers

UI5 . data-sap-ui-preload="async"

<script src="resources/sap-ui-cachebuster/sap-ui-core.js" id="sap-ui-bootstrap"
         data-sap-ui-libs="sap.ui.commons,sap.ui.table,sap.ui.ux3,sap.m"
         data-sap-ui-theme="sap_bluecrystal" 
         data-sap-ui-preload="async"
         data-sap-ui-appCacheBuster="./">

API- SAPUI5 attachInitEvent

var oCore = sap.ui.getCore();
oCore.attachInit(function() {
    //do the needful
});
+5

: sap.ui.commons,sap.ui.table,sap.ui.ux3,sap.m

, , :

 <script src="resources/sap-ui-cachebuster/sap-ui-core.js" id="sap-ui-bootstrap"
     data-sap-ui-libs="sap.ui.commons,sap.m"
     data-sap-ui-theme="sap_bluecrystal" 
     data-sap-ui-appCacheBuster="./">

 <script src="resources/sap-ui-cachebuster/sap-ui-core.js" id="sap-ui-bootstrap"
     data-sap-ui-libs="sap.ui.table,sap.ui.ux3"
     data-sap-ui-theme="sap_bluecrystal" 
     data-sap-ui-preload="async"
     data-sap-ui-appCacheBuster="./">
0

All Articles