I have completed an app in SAPUI5 & deployed in FLP. It takes more than a minute to load for the first time after which it takes only 2 to 3 seconds.
When I run Performance in Chrome console, it shows scripting takes too much time. How can I reduce my app's initial loading time?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Orders</title>
<script id="sap-ui-bootstrap"
src="/sap/public/bc/ui5_ui5/1/resources/sap-ui-core.js"
data-sap-ui-libs="sap.m, sap.ui.core"
data-sap-ui-theme="sap_belize"
data-sap-ui-bindingSyntax="complex"
data-sap-ui-compatVersion="edge"
data-sap-ui-preload="async"
data-sap-ui-resourceroots='{"orders": "."}'
></script>
<script>
sap.ui.getCore().attachInit(function () {
sap.ui.require([
"sap/m/Shell",
"sap/ui/core/ComponentContainer"
], function (Shell, ComponentContainer) {
new Shell({
app: new ComponentContainer({
height : "100%",
name : "orders"
})
}).placeAt("content");
});
});
</script>
</head>
<body class="sapUiBody" id="content">
</body>
</html>
sap.ui.define([
"./BaseController",
"sap/ui/model/json/JSONModel",
"sap/ui/core/routing/History",
"../model/formatter",
"sap/ui/model/Filter",
"sap/ui/model/FilterOperator",
"sap/m/MessageToast"
], function(BaseController, JSONModel, /* ... */) { /*... */ }));
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
xmlns:semantic="sap.m.semantic"
xmlns:core="sap.ui.core"
xmlns:table="sap.ui.table"
xmlns:smartTable="sap.ui.comp.smarttable"
xmlns:customData="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
controllerName="orders.controller.Worklist"
>
<!-- ... -->
</mvc:View>
Component Preload file helps in increasing your app performance in intial load. You can create this file easily, for example, from SAP Web IDE: right click on the project → Build → Build Project to create / update the preload file.